Tell, don't ask

From CSSEMediaWiki
Revision as of 04:44, 29 July 2008 by Johannes Pagwiwoko (Talk | contribs)
Jump to: navigation, search

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 decisions based on its internal information. It does not care about or need to obtain external information before telling the other object what to do. This makes the implementation cleaner and simpler.

Example

Personal tools