Motivation To reduce the size of a class that has many methods. Also to allow step-by-step construction of a target object. Intent Separate the construction of …
Motivation Sometime a toolkit class that’s designed for reuse isn’t reusable only because its interface doesn’t match the domain-specific interface an …
Motivation Structuring a system in to subsystem helps reduce complexity. A common design goal is to minimize the commutation and dependencies between systems. …
Motivation There are cases in programming where it seems that you need to generate a very large number of small class instances to represent data. Sometimes …
Motivation It is important for some classes to have exactly one instance. As an example although there can be many printers in a system, there should be only …
Motivation Object-oriented developers strive to keep object loosely coupled, keeping the responsibility between objects specific and minimal.. This leads to …
Definition Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. …
Motivation As a class developer, you will ordinarily provide class constructors to let users of your class instantiate it. However, a client that needs an …
Intent Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for extending functionality. …
Motivation There are situations where the classes differ only by their behaviour, and on such situations it is advisable to isolate the algorithms into …