EDMA: Entorno de Desarrollo Modular y Abierto
Object Oriented and Componentware Framework

Copyright (C) 1998, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
           by David Martínez Oliveira

See file COPYING and COPYING.LESSER for copying conditions
==========================================================================

Design Pattern Examples
---------------------------
These examples implement some classical Design Patterns using GNU/EDMA.

Compile them with:

make -f all.mk

* Briefing
-----------------------------
The dynamic features of GNU/EDMA make some classical design patterns very easy to implement. In this directory the following examples are provided:

- Adapter
The adapter pattern in GNU/EDMA gets reduced to attaching a subclass to the object that needs to be adapted. In the example the class PERSON is adapted to support a new interface with new methods.

- Bridge
The adapter in GNU/EDMA can be implemented in different ways. The most straightforward implementation is through the use of the dynamic inheritance properties of the system. At some extends this pattern can be seen as a way to add delegation capabilities to languages that do not have it. Delegation in GNU/EDMA is built-in

The example show how to use this pattern, dynamically or statically.

- Chain of Responsibilities
This example implements the chain of responsibilities as an INNER class hierarchy. Each class in the hierarchy processes the request if possible and otherwise propagates the request to the next subclass.


- Decorator
The decorator pattern is trivial on GNU/EDMA. Just add the additional behavior as a subclass dynamically, and call super class behaviors if required.


- State
The state pattern can be easily implemented using subclasses for each state. As subclasses can be changed dynamically, nothing else special is required. The example implements a QUEUE class with three states: EMPTY, NORMAL and FULL.
