Software Design Patterns Flashcards
The scope of a design pattern has to do with what 2 sub-categories?
- Class
- Object
What 2 criteria are used to classify design patterns?
- Purpose
- Scope
What are 2 examples of the Factory Method?
- C# GetEnumerator
- JavaScript createElement
What are Design Patterns?
A generalized way of solving common problems or types of problems in a given field
What are the 3 purpose sub-categories for classifying design patterns?
- Creational
- Structural
- Behavioural
What classification is the Factory method?
Class Creational Pattern
What does a behavioural class pattern do?
Uses inheritance to describe algorithms and flow control
What does a behavioural object pattern do?
Describes how a group of objects cooperate to perform a task that no single object can carry out alone
What does a creational class pattern do?
Defers some part of object creation to subclasses
What does a creational object pattern do?
Defers object creation to another object
What does a structural class pattern do?
Uses inheritance to compose a class
What does a structural object pattern do?
Describes a way to assemble objects
What else is the Factory Method know as?
Virtual Constructor
What is an alternative to using a Singleton pattern?
A Global Variable
What is the intent of a Singleton pattern?
Ensure a class has only one instance, and provide a global point of access to it
What is the intent of the Factory Method?
Define an interface for creating an object and let subclasses decide which class to instantiate
What type of pattern is a Singleton?
Object Creational Pattern