Design Patterns Flashcards
What is the relationship between refactoring and design patterns?
We can REFACTOR TOWARDS a design pattern (not necessarily match)
What are the 3 groups of design patterns?
Behavioural
Structural
Creational
Which design pattern allows an object to change its behaviour based on it’s internal state?
the state pattern
Which design pattern allows an object to change how it performs a task?
the strategy pattern
What does the factory design pattern refer to?
A CLASS who’s job is to CREATE objects
What does the singleton design pattern refer to?
A CLASS that only has ONE INSTANCE with a GLOBAL POINT OF ACCESS
What does the adapter design pattern refer to?
Convert one interface into ANOTHER using a WRAPPER CLASS
Which design pattern refers to composing a tree structure of objects? Benefit?
The composite design pattern, It allows the client to use an individual part (object) and the whole composition (tree) in the same way