This project should represent a complete set of all the GoF design patterns implemented in Delphi.
Originally created by Elector and published to delphipatterns.codeplex.com (Archive link), but is no longer available there.
Each pattern is implemented in separate directory & project. The pattern is in the*.pattern.pas file, while the example is in the *.example.pas file.
Each included pattern, links to the files, and a short description. Read more on Wikipedia.
Most behavioral design patterns are specifically concerned with communication between objects.
- Chain of Responsibility [Usage] - delegates commands to a chain of processing objects. [more info]
- Command [Usage] - creates objects that encapsulate actions and parameters. [more info]
- Interpreter [Usage] - implements a specialized language. [more info]
- Iterator [Usage] - accesses the elements of an object sequentially without exposing its underlying representation. [more info]
- Mediator [Usage] - allows loose coupling between classes by being the only class that has detailed knowledge of their methods. [more info]
- Memento [Usage] - provides the ability to restore an object to its previous state (undo). [more info]
- Observer [Usage] - a publish/subscribe pattern, which allows a number of observer objects to see an event. [more info]
- State [Usage] - allows an object to alter its behavior when its internal state changes. [more info]
- Strategy [Usage] - allows one of a family of algorithms to be selected on-the-fly at runtime. [more info]
- Template Method [Usage] - defines the skeleton of an algorithm as an abstract class, allowing its subclasses to provide concrete behavior. [more info]
- Visitor [Usage] - separates an algorithm from an object structure by moving the hierarchy of methods into one object. [more info]
Patterns that create objects, rather than having to instantiate objects directly. This gives the program more flexibility in deciding which objects need to be created for a given case.
- Abstract Factory [Usage] - groups object factories that have a common theme. [more info]
- Builder [Usage] - constructs complex objects by separating construction and representation. [more info]
- Factory Method [Usage] - creates objects without specifying the exact class to create. [more info]
- Singleton [Usage] - restricts object creation for a class to only one instance. [more info]
Patterns that concern class and object composition. They use inheritance to compose interfaces and define ways to compose objects to obtain new functionality.
- Adapter [Usage] - allows classes with incompatible interfaces to work together by wrapping its own interface around that of an already existing class. [more info]
- Bridge [Usage] - decouples an abstraction from its implementation so that the two can vary independently. [more info]
- Composite [Usage] - composes zero-or-more similar objects so that they can be manipulated as one object. [more info]
- Decorator [Usage] - dynamically adds/overrides behavior in an existing method of an object. [more info]
- Facade [Usage] - provides a simplified interface to a large body of code. [more info]
- Proxy [Usage] - provides a placeholder for another object to control access, reduce cost, and reduce complexity. [more info]
- Creational
- Prototype Implementation missing - creates objects by cloning an existing object. [more info]
- Dependency Injection - class accepting the objects it requires from an injector instead of creating the objects directly.
- Lazy initialization (aka Virtual Proxy) delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed.
- Multiton Ensure a class has only named instances, and provide a global point of access to them.
- Object pool Avoid expensive acquisition and release of resources by recycling objects that are no longer in use.
- Structural
- Delegation - Extend a class by composition instead of subclassing. The object handles a request by delegating to a second object (the delegate)
- Flyweight Implementation missing - reduces the cost of creating and manipulating a large number of similar objects. [more info]
- Other
- Many more...
The license is still Common Development and Distribution License (CDDL), the same as the original implementation. According to FOSSA it has similar provisions to the Mozilla Public License 2.0 and the Eclipse Public License.