Design Patterns Flashcards
What do Creational patterns deal with?
How an object is created
What are the two basic ideas behind creational design patterns?
- Encapsulating the knowledge of which concrete types should be created
- Hiding how the instances of these types are created
List five well-known patterns that are part of the creational pattern category.
- The abstract factory pattern
- The builder pattern
- The factory method pattern
- The prototype pattern
- The singleton pattern
What does the abstract factory pattern do?
Provides an interface for creating related objects without specifying the concrete type
What does the builder pattern do?
Separates the construction of a complex object from its representation, so the same process can be used to create similar types.
What does the factory method pattern do?
Creates objects without exposing the underlying logic of how the object (or which type of object) is created.
What does the prototype pattern do?
Creates an object by cloning an existing one.
What does the singleton pattern do?
Allows one (and only one) instance of a class for the lifetime of an application.
What are structural patterns?
Structural patterns concern types and object compositions
What do behavioural patterns do?
Communicate between types.
What do structural design patterns describe?
How types can be combined to form larger structures.
List seven well-known patterns that are part of the structural design pattern type?
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
What does the adapter pattern do?
Allows types with incompatible interfaces to work together
What is the bridge pattern used for?
To separate the abstract elements of a type from the implementation so the two can vary.
What does the composite pattern do?
Allows the application to treat a group of objects as a single object.