Design Patterns Flashcards
Patterns
A general reusable solution to a commonly occurring problem within a given context in software design.
A template, not a finished design.
Benefits of using a pattern
Industry Standard Approach
Reusability
Easy to understand and debug
Saves time/cost
Idioms
an expression of a simple task, algorithm, or data structure that is not a built-in feature in the programming language being used,
VarArgs
You need to pass in many instances of the same object type to a method, but you don’t know at compile time how many instances there will be.
for(String s : str)
Creational Patterns
about class instantiation or object creation
Structural Patterns
organising different classes or objects to create bigger structures and provide new functionality
Behavioural Patterns
identifying common communication patterns between objects and identifying this pattern