Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

Package dk.rode.thesis.meta.reflect.proxy

Utilities to create dynamic proxies.

See:
          Description

Interface Summary
ProxyFactory.Proxy All proxies created by a proxy factory will be tagged with this adapter interface, allowing for later retrieval of the actual proxy factory that created the proxy as well as the unique handler associated with it.
Reference<T> A reference is used to handle the number of references to a given shared object: as long as only non-mutable methods are invoked on the referenced object, the object can be shared among several proxies.
 

Class Summary
ProxyFactory A proxy factory creates dynamic proxies, which can also be used for duck typing.
ProxyFactory.Key A key adapts a proxy to ensure consistent hashCode() and equals(Object) behaviour when proxies are stored internally by proxy factories, because proxies may override hashCode and equals(Object) in unpredictable ways.
ReferenceHandler<T> A reference handler is the standard implementation of the Reference interface.
ReferenceInvocationHandler A reference invocation handler is an invocation handler that has support for referenced objects.
 

Package dk.rode.thesis.meta.reflect.proxy Description

Utilities to create dynamic proxies.

The ProxyFactory class is used to create dynamic proxies based on java.lang.reflect.Proxy instances. The factory supplies various methods to construct proxies, but is also open for sub-classing for further specialisation and creation of proxies.

The Reference interface is used to handle the number of references to a given shared object: as long as only non-mutable methods are invoked on the referenced object, the object can be shared among several proxies. Once a given mutator method is invoked, the referenced object will be copied using a specified copy method. The ReferenceInvocationHandler class is used by proxies representing shared objects, and the ReferenceHandler is the standard implementation of Reference, though others can naturally be implemented as well.

Author:
Gunni Rode / rode.dk

Gunni Rode / rode.dk

Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!

The original thesis and source code are available at rode.dk/thesis.