Skip to content

Commit 889fa17

Browse files
committed
work in progress on composite, iterator, proxy and mediator
1 parent b3016f1 commit 889fa17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

notes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Adapter V Facade V Proxy V Decorator
2-
• Adapter adapts a given class/object to a new interface. In the case of the former, multiple inheritance is typically employed. In the latter case, the object is wrapped by a conforming adapter object and passed around. The problem we are solving here is that of non-compatible interfaces.
3-
• Facade is more like a simple gateway to a complicated set of functionality. You make a black-box for your clients to worry less i.e. make interfaces simpler.
4-
• Proxy provides the same interface as the proxied-for class and typically does some housekeeping stuff on its own. (So instead of making multiple copies of a heavy object X you make copies of a lightweight proxy P which in turn manages X and translates your calls as required.) You are solving the problem of the client from having to manage a heavy and/or complex object.
5-
• Decorator is used to add more gunpowder to your objects (note the term objects -- you typically decorate objects dynamically at runtime). You do not hide/impair the existing interfaces of the object but simply extend it at runtime.
2+
• Adapter adapts an existing class/object to a new interface. Make incompatible interface compatible.
3+
• Facade is a class that simplifies a complicated set of functionality.
4+
• Proxy provides the same interface as the subject class and allows additional functionality to be added.
5+
• Decorator is a wrapper to extend functionality to an existing class at runtime.

0 commit comments

Comments
 (0)