You are not logged in Log in Join
You are here: Home » Members » Phillip J. Eby's Zope Center » My Wikis » ZPatterns Wiki » InformationHiding » wikipage_view

Log in
Name

Password

 
 
HomePage » DemetersLaw »

InformationHiding

Information Hiding is the idea that one should minimize the number of parts of a system that are aware of any particular "knowledge" of how the system works. This reduces the number of things one has to change when the "knowledge" needs to change, which reduces the chance that you will change one of them incorrectly, forget to change one, etc. (Information hiding is sometimes called the "DRY" principle: Don't Repeat Yourself.)

This principle is a cornerstone of object engineering, since one good reason for putting methods in a class is to hide their implementation knowledge from the rest of the system. However, object systems can be brittle if they rely on too much knowledge about how particular objects are constructed (see DemetersLaw) or on which class(es) should be used for a task. And in Zope, objects which know how other objects are stored are similarly brittle. All of the ZPatterns tools are designed not only to hide as much of their own information as possible, but to help developers hide information from other parts of their own applications as well.