|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Stringable<T extends Stringable<? super T>> | A stringable object can be formatted into different
textual char sequence representations using a given
policy to determine the format. |
StringablePolicy<T> | Returns a textual representation in form of a char sequence
of a given stringable object. |
Class Summary | |
---|---|
Main | Strategy tests. |
StringablePolicy.NameIdiom | An idiom that allows the retrieval of a given StringablePolicy
defined as an enumeration constant based on an exact name of
another, possibly unrelated, policy. |
Enum Summary | |
---|---|
ObjectPolicy | Standard policies for formatting any type of Object
into textual representations in form of char sequences (appendable)
or as strings (immutable). |
SequencePolicy | Default policies for formatting Sequence
objects into textual representations in form of
char sequences. |
StringablePolicy.Type | A policy type is a hint a stringable
context can use to decide how to use the textual representation a
given policy generates in conjunction with
additional textual information required to generate an overall
representation. |
Implementations and examples of the Strategy design pattern [Gamma95, p.315].
Intent:
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
StringablePolicy
interface that allows the Context participant in form
of Stringable
objects
to have numerous different textual representations. As
Sequence
implements
the Stringable
interface, any sequence implementation
is thus a representation of the Context participant.
The enumerations ObjectPolicy
and SequencePolicy
represent
the ConcreteStrategy participant, each defining many different
policies (strategies) for formatting Object
and
Sequence
instances,
respectively.
|
Gunni Rode / rode.dk | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |