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

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

See the end of the file for license 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.

.

EDMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

EDMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with EDMA.  If not, see <http://www.gnu.org/licenses/>.
