Design patterns Flashcards
What is a design pattern
A design pattern describes a problem that occurs over and over again in our environment and then describes the core solution to the problem in a way that you can use this solution without doing it the same way twice
what are some examples of software engineering patterns
Observer Façade Iterator Decorator Adapter
What does an observer deign pattern handle
If we are soring data and we want to an easy way to update all of the displays when the data changes
Why would you use an observer pattern
Easy to build, Good for standardisation
What is a façade design pattern used for
Used when describing a standard way of grouping together similar interfaces into a class
What is iterator design pattern used for
It provides a common design for algorithms which operate on a collection of items
When will you typically come across iterator patterns
Processing lists or sets
When are adaptor design patterns used
Translates the interface of one class into that of another
What to variants do adapter designs come in
Object or class
What is the decorator pattern used for
Used to extend the functionality of an class or object
What do decorator patterns allow for
Run time alternative to sub classing
Responsibilities to be added to or removed from an object at run time