









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










09/09/17 Design Patterns 4
Two main benefits to manipulating objects solely in terms of the interface defined by abstract classes , as opposed to class inheritance
Disadvantage of delegation approach, highly parameterized softwa harder to understand than more static software. State, Strategy , and Visitor patterns depend on delegation.
The key to maximizing reuse lies in anticipating new requirements and changes to existing requirements, and in designing your system so that they can evolve accordingly. Some common causes of redesign and patterns to address them: 1 Creating an object by specifying a class explicitly. Specifying a class name when you create an object commits you to a particular implementation instead of a particular interface. This commitment can complicate future changes. To avoid it, create objects indirectly. Design patterns: Abstract Factory, Factory Method, Prototype. 2 Dependence on specific operations. By avoiding hard-coded requests, you make it easier to change the way a request gets satisfied both at compile-time and at run-time. Design patterns: Chain of Responsibility, Command.
6 Tight coupling. Classes that are tightly coupled are hard to reuse in isolation, since they depend on each other. Design patterns: Abstract Factory, Bridge, Chain of Responsibility, Command, Facade, Mediator, Observer. 7 Extending functionality by subclassing. Design patterns: Bridge, Chain of Responsibility, Composite, Decorator, Observer, Strategy. 8 Inability to alter classes conveniently. Design patterns: Adapter, Decorato, Visitor.
09/09/17 Design Patterns 13
Behavioral Chain of Resp. object that can fulfill a request Command when and how a request is fulfilled Interpreter grammar and interpret. of a language Iterator how an aggregate's elements are accessed, traversed Mediator how and which objects interact with each other Memento what private information is stored outside an object, and when Observer number of objects that depend on another object State states of an object Strategy an algorithm Template Method steps of an algorithm Visitor operations that can be applied to object(s) without changing their
09/09/17 Design Patterns 14 How to Use a Design Patterns 1. Read the pattern once through for an overview