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

dk.rode.thesis.abstractfactory
Interface GeneratorFactory<E,P>

Type Parameters:
E - The type of values generated by created generators.
P - The type of argument required in the creation process. Use Void if no arguments are required.
All Known Implementing Classes:
CollectionValueFactory, RangeValueFactory, StandardFactory

@ParticipantUsage(value="AbstractProduct",
                  type=SequenceValueGenerator.class)
@Participant(value="AbstractFactory")
public interface GeneratorFactory<E,P>

A generator factory can create sequence value generators used as implementations for sequence abstractions.

Author:
Gunni Rode / rode.dk
See Also:
SequenceFactory, AbstractionFactory

Method Summary
 SequenceValueGenerator<E> createGenerator()
          Creates a new sequence value generator using the default argument.
 SequenceValueGenerator<E> createGenerator(P argument)
          Creates a new sequence value generator, where argument is an argument used in the creation process of the generator.
 P getDefaultArgument()
          Returns the default argument to use for generator creation in case no argument is supplied to the createGenerator(Object) method.
 

Method Detail

createGenerator

SequenceValueGenerator<E> createGenerator()
Creates a new sequence value generator using the default argument.

Returns:
A new created generator; never null.
See Also:
createGenerator(Object), getDefaultArgument()

createGenerator

SequenceValueGenerator<E> createGenerator(P argument)
Creates a new sequence value generator, where argument is an argument used in the creation process of the generator.

Parameters:
argument - A context supplied argument to use in the construction of the generator, if any. If null, the default argument is used (which may also be null, depending on the actual implementation).
Returns:
A new created generator; never null.
See Also:
createGenerator()

getDefaultArgument

P getDefaultArgument()
Returns the default argument to use for generator creation in case no argument is supplied to the createGenerator(Object) method.

Returns:
The default argument, if any; can be null, depending on the actual implementation.

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.