Package net.sf.jaxme.js.pattern

The pattern package This package contains a set of design patterns implemented with the JaxMe JavaSource generator framework.

See:
          Description

Interface Summary
VersionGenerator.ColumnUpdater The ColumnUpdater is able to update one or more columns in a table.
 

Class Summary
Ant A set of Ant tasks for running the generators in the pattern package.
Ant.AntChainGenerator  
Ant.AntProxyGenerator  
Ant.AntTypesafeEnumerationGenerator  
Ant.AntVersionGenerator  
Ant.BasicAntTask  
Ant.ReallyBasicAntTask  
ChainGenerator This class generates so-called event chains.
ProxyGenerator This class is a generator for the proxy object pattern.
ProxyGenerator.GeneratedMethod This class describes a generated method.
ProxyGenerator.InterfaceDescription This class describes the properties of an interface, which is extended by the generated class.
TypesafeEnumerationGenerator This class is a generator for the typesafe enumeration pattern.
TypesafeEnumerationGenerator.Item  
VersionGenerator The VersionGenerator is able to clone a version of a row in a database.
VersionGenerator.TableInfo This class is used internally to maintain the informations on the tables being cloned.
 

Package net.sf.jaxme.js.pattern Description

The pattern package

This package contains a set of design patterns implemented with the JaxMe JavaSource generator framework. It is provided both for demonstration and actual use. Each pattern is accompanied with a corresponding Ant task that allows to invoke the respective generator from within an Ant build script. The patterns are:

Design pattern(s)ClassAnt taskDescription
Proxy objects
Multiple inheritance
ProxyGenerator proxyGenerator Proxy are instances that delegate most or all method calls to another object. Proxy objects in Java are typically created by the class Proxy. Compared to this class, the generator has the advantage, that it is much easier to adapt the proxy object to your own needs: In our case you simple subclass the generated Proxy class.
Proxy objects can also be used to implement something like multiple inheritance. This is demonstrated in the Unit test MultipleInheritanceTest, where a subclass of Observable is created, that is also an instance of List by inheriting from ArrayList.
Typesafe enumerations TypesafeEnumerationGenerator enumGenerator A typesafe enumeration is a Java class that guarantees that only a specified set of instances can exist. These instances are part of the class and accessible through public, static, final fields.
Proxy chains ChainGenerator chainGenerator A proxy chain can be viewed as a set of event handlers implementing a common interface. The interface methods are the events being processed. Each element in the chain can decide to process an event alone (by returning immediately), to delegate the event to the next element in the chain (by calling the interface method in its superclass) or to post process the result of the delegated event.