Final Flashcards
This pattern allows an object to alter its behavior when its internal state changes, causing the object to appear as if it alter its class membership, i.e., changed subclasses.
State
This pattern addresses situations where there are multiple ways of doing the same kind of thing, but with different kinds of input, output, or runtime characteristics and the choice of which way to do it has to be made at runtime
Strategy
This pattern should not be used an excuse to violate the “no global variables” rule.
Singleton
An application of this pattern defines a high-level interface that can make a subsystem easier to use.
Façade
The solution for this pattern creates a multicast-style of communication (which may be method calls), where a sender object does not need to know about the specific receivers and there can be multiple receivers.
Observer
This pattern is also called View-Model-Binder
MVVM
This pattern is often used in conjuction with the Strategies pattern to leverage reuse amoung concrete strategies
Template Method
Select a creational pattern with class scope, i.e. a pattern who primary purpose is to create objects and whose solution relies primarily on inheritance.
Factory Method. If you ignore the inheritence part, then also Factory Idiom.
The pattern can address the problem of accessing remote object as if they were local and hide the true location of an object
Proxy
This pattern is useful when an extension can result in an exponential explosion of subclasses.
Decorator
This pattern has the negative consequence that adding new kinds of product (i.e., classes) may be difficult, i.e., result in lots of changes to existing code
Abstract Factory
Select a compound pattern
MVC, MVP, MVVM
With this pattern, it is easy to add new behaviors to a class of objects
State, Visitor, Decorator
With this pattern, it is easy to extend a system with a new family of products that parallel existing families of product from a functional perspective.
Abstract Factory
This pattern allows for the attachment of any combination of additional responsibilities to an object at run time.
Decorator
By itself, the pattern does not enforce encapsulation of components in a subsystem, but makes it easier to work with them.
Façade
The solution of this pattern has the developer define the skeleton of an algorithm in a method and defer the specifics of some steps of that algorithm to subclasses.
Template Method
This pattern defines a readable and extensible way to perform operations over a collection of elements, without breaking the encapsulation of the collection or its elements.
Visitor, and to a lesser extent Iterator
Select a pattern that can be implemented with either object (delegation) or class scope (inheritance).
Adapter
This pattern ensures that a class has only one instance.
Singleton
The solution proposed by this pattern is to extract from a class (i.e., the context) certain behaviors that represent different algorithms for the same basic kind of operation and then encapsulate them in a hierarchy of classes, where each of concrete classes represents a different algorithm.
Strategy
Consider using this pattern in any system that includes a collection of objects and you need to traverse through that collection
Iterator
This pattern allows algorithms to be selected at runtime, by defining a family of algorithms, encapsulating each algorithm, and making the algorithms interchangeable within that family.
Strategy
If generics are not available, then adding a new concrete element types can be hard for the solution of this pattern
Visitor