COMP2007-Design patterns Flashcards

0
Q

Gamma, Helm, Johnson, Vlissides
Gang of four
23 patterns

A

Defined by

  • pattern name
  • problem/usage
  • solution
  • consequences
Intent
Aka
Motivation
Applicability
Structure
Participants
Collaborations
Consequences
Implementation techniques
Known uses
Related patterns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Design patterns

A

Tried and tested solutions for recurring problems in programming

Good patterns

  • be as general as poss
  • proven solution

You must know

  • problem you’re facing
  • know design patterns
  • understand relationships btwn classes and how to allocate responsibilities to them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Patterns are classified into

A

Creational - concerned with object construction and the installation process

Structural - concerned with composition of classes/objects: how classes and objects are composed to form larger structures

Behavioural - concerned with the way classes and objects interact/patterns of communication between classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Interface

A

Set of methods (and variables) that one class allows other classes to access

A CLASS i n t e r f a c e speaking abstractly is the collection of methods and fields that the class permits other classes to access.

A class implements a given interface by means of the code in its methods

Interface defined by what it does, not how its implemented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Structural patterns

A
  1. Adapter
  2. Bridge
  3. Composite
  4. Decorator
  5. Facade
  6. Flyweight
  7. Proxy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Creational patterns

A
  1. Factory method
  2. Abstract factory
  3. Builder
  4. Prototype
  5. Singleton
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Behavioural patterns

A
  1. Chain of responsibility
  2. Command
  3. Interpreter
  4. Iterator
  5. Mediator
  6. Memento
  7. Observer
  8. State
  9. Strategy
  10. Template method
  11. Visitor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly