andybui01 / 2511-notes

Object Oriented programming notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2511-notes

Object Oriented programming notes. This README only includes basic notes.

Design patterns

Structural:

As its name implies, it provides a framework as to how code should be structured to fit within the constraints of good design. There are no specific implementations and it serves as a guideline more than a strict instruction set.

Example patterns:

  • Adapter
  • Composite
  • Decorator

Behavioural:

Behavioural patterns structural patterns a step further and enforce a stricter ruleset in terms of how the pattern should be implemented. This manifests in the form of required methods and classes. An example of this is the notifyAll() methods often found within the subject class in observer patterns. The pattern would not be complete without the subject being able to notify its observers of changes.

Example patterns:

  • Iterator
  • Observer
  • State
  • Strategy
  • Template
  • Visitor

Creational patterns

Creational patterns mainly relate to the mechanism we use to create instantiate objects.

Example patterns:

  • Factory
  • Abstract factory
  • Builder
  • Singleton

About

Object Oriented programming notes