Design Patterns

  • Flyweight

    Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Client: Code that uses the flyweight implementation Concrete Flyweight: A class that actually implements the abstract class/interface flyweight. Extrinsic State: State that is not common to the flyweights and varies per instance. Flyweight: An interface that defines…

  • Factory Method

    Quick Information/Overview Pattern Type Creational Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Moderate — slightly easier than Abstract Factory Up Front Definitions Creator: This is the basic, abstract factory interface. Concrete Creator: Inheritor factory classes that implement some actual object creation scheme. Product: This is the base/abstract polymorphic object that gets created by…

  • Facade

    Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions The Problem Let’s say that you work on a web based piece of software that processes orders for customers in some sort of retail capacity and that there is a framework for a lot of existing…

  • Decorator

    Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Decorator: An object that is both an inherits from and operates on another object. Component: Abstract target base class (or interface) of the decorator pattern. Target: For the purposes of this post, I use this term interchangeably…

  • Composite

    Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Component: This is the abstract object that represents any and all members of the pattern Composite: Derives from component and provides the definition for the class that contains other components Leaf: A concrete node that encapsulates…