Welcome to the design patterns repository.
This repository contains notes and code examples (included in the projects readMe) on various computing design patterns. Each project is inspired by the text Design Patterns : Elements of Reusable Object-Orientated Software.
The notes and accompanying code examples are a summary and spin on the patterns described in the book. Each code example contains a basic situation where the particular design pattern can be applied.
The code provided is written in Java.
- Abstract Factory - Generically creating objects on behalf of a client.
- Builder Pattern - Providing attributes to a builder to put together and return an object when requested.
- Composite Pattern - Creating an object or group of objects that are treated in the same way.
- Factory Method - Providing an interface that allows subclasses to decide on the object to instantiate.
- Prototype Pattern - Create objects and cache them when required, return clones from the cache if requested again.
- Singleton Pattern - Allow only a single instance of the object to be created and global access to it.
- Adapter Pattern Convert the interface of one class to another to allow classes that are incompatible to work together.
- Bridge Pattern - Providing an interface bridge that allows an abstraction to refer to its implementation through the interface.
- Composite Pattern - Provide an interface that allows individual objects and groups of objects to appear the same.
- Decorator Pattern - Provide additional behaviour to an object dynamically. The object is invoked by the delegate.
- Facade Pattern - Provide a common interface to allow clients to access different components without directly referencing them.
- Flyweight Pattern - Re-use objects by re-loading data into the object when required by different contexts.
- Proxy Pattern - Provide a placeholder (proxy) object that looks like the real object. The proxy instantiates the real object when required, useful for expensive objects.