Tell, don't ask

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(adding tell dont ask principle)
 
Line 1: Line 1:
In software engineering, the "Tell, Don't Ask" principle states that objects should tell each other what to do by issuing commands to one another, rather than asking each other for information and then make decisions based on the information obtained. As a consequence, an object only makes decision based on its internal information. It does not need to care, neither it needs to obtain external information before telling the other object what to do. This makes the implementation cleaner and simpler.
+
In software engineering, the "Tell, Don't Ask" principle states that objects should tell each other what to do by issuing commands to one another, rather than asking each other for information and then make decisions based on the information obtained. As a consequence, an object only makes decision based on its internal information. It does not need to care about, neither it needs to obtain external information before telling the other object what to do. This makes the implementation cleaner and simpler.
  
 
(example will be put out soon)
 
(example will be put out soon)

Revision as of 02:23, 24 July 2008

In software engineering, the "Tell, Don't Ask" principle states that objects should tell each other what to do by issuing commands to one another, rather than asking each other for information and then make decisions based on the information obtained. As a consequence, an object only makes decision based on its internal information. It does not need to care about, neither it needs to obtain external information before telling the other object what to do. This makes the implementation cleaner and simpler.

(example will be put out soon)

Personal tools