Design Patterns Flashcards
Name 5 design patterns? (AABCF)
Composite Adapter Bridge Facade Abstract
What is a design pattern?
A reusable template for solving a recurring design problem
What makes a design modifiable?
Low coupling and high cohesion
Clear dependencies
Explicit assumptions
How do design patterns help?
They are generalised from existing systems
They provide a shared vocabulary to designers
They provide examples of modifiable designs
->Abstract classes
->Delegation
Define software system?
Consists of subsystems which are either other subsystems or collection of classes
Define software lifecycle?
Consists of a set of development activities which are either other activities or collections of tasks
What is a adapter pattern?
Lets classes work together that couldn’t otherwise because of incompatible interfaces.
(English speaker example)
What is a bridge pattern?
Can be used to provide multiple implementations under the same interface
(Drawing and shapes example)
What is a facade pattern?
Provides a unified in face to a set of classes in a subsystem
(Messy design)
What is a composite pattern?
Lets a client treat individual objects and compositions of these objects uniformly
(GUI example)
What is a abstract factory pattern?
Allows you to create objects without specifying the exact class of object that will be created
(UFO, Rocket, Boss UFO example)
Some design patterns use what?
Delegation and inheritance