Hide Delegate
From CSSEMediaWiki
(Difference between revisions)
(New page: A client is calling a delegate class of an object. Create methods on the server to hide the delegate. image:hideDelagate.gif <br> One of the keys, if not the key, to objects is encaps...) |
m (Reverted edits by Ebybymic (Talk); changed back to last version by Aidan Bebbington) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
[[image:hideDelagate.gif ]]<br> | [[image:hideDelagate.gif ]]<br> | ||
− | One of the keys, if not the key, to objects is encapsulation. Encapsulation means that objects need to know less about other parts of the system. Then when things change, fewer objects need to be told about the change—which makes the change easier to make. | + | |
+ | One of the keys, if not the key, to objects is encapsulation. Encapsulation means that objects need to know less about other parts of the system. Then when things change, fewer objects need to be told about the change—which makes the change easier to make. Essentially, we have decoupled the Client Class from the Department class so that it will not be affected by changes to the department. | ||
+ | |||
+ | == See Also == | ||
+ | * [[Law of Demeter]] | ||
+ | |||
== Additional Resources == | == Additional Resources == | ||
[http://sourcemaking.com/refactoring/hide-delegate SourceMaking.com] | [http://sourcemaking.com/refactoring/hide-delegate SourceMaking.com] |
Latest revision as of 03:23, 25 November 2010
A client is calling a delegate class of an object. Create methods on the server to hide the delegate.
One of the keys, if not the key, to objects is encapsulation. Encapsulation means that objects need to know less about other parts of the system. Then when things change, fewer objects need to be told about the change—which makes the change easier to make. Essentially, we have decoupled the Client Class from the Department class so that it will not be affected by changes to the department.