Parry's Patterns Page

What is a Design Pattern?

A design pattern is a proven solution for a general design problem. It consists of communicating classes and objects that are customised to solve the problem in a particular context. The usefulness of the solution a pattern presents has been proven in many designs. As such it captures design experience of experienced programmers. A designer who is familiar with such patterns can apply them immediately to design problems without having to rediscover them. This way design patterns make it easier to reuse successful designs and architectures. Expressing proven techniques as design patterns makes them more accessible to developers of new systems. Design patterns help you choose design alternatives that make a system reusable and avoid alternatives that compromise reusability. Design patterns can even improve the documentation and maintenance of existing systems by furnishing an explicit specification of class and objects interactions and their underlying 'intent'. Put simply, design patterns help a designer get a design 'right' faster. The design patterns are not about designs such as linked lists and hash tables that can be encoded in classes and reused as is. Nor are they complex, domain specific designs for an entire application or subsystem.

The following Design Patterns are from the Whiteants ModelMaker Manual

Wrapper pattern (also called 'Adapter'), converts the interface of a class into another interface clients expect. Mediator pattern, creates event handlers for a 'used' class and wires them. Singleton pattern, ensures a class only has one instance, and provides a global point of access to it. Decorator pattern, attaches additional responsibilities to an object dynamically. Lock pattern, provides a mechanism to temporarily lock some aspect of a class. Visitor pattern, represents an operation to be performed on the elements of an object structure by a class. Observer pattern, defines a one-to-many dependency between objects so that when one object changes state, all its dependants are notified.

I've also written an example to illustrate the two most common Design Patterns in designing a Data Aware Component.

In addition I've put together a worked example of the following patterns from the Design Patterns Book.