|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Participant(value="Context") public interface StepSequence
A step sequence represents an unbounded integer value that
is increased/decreased with a given step with each call to
Sequence.next()
. The step may be negative, but not zero.
A step sequence is unbounded
, but
unique
and consistent
.
Step sequences are created by the StepSequence.Factory.create(int, int)
factory method.
Implementation notes:
A step sequence is implemented using dynamic proxies. It will appear to change
its class (state) when the sequence value changes from even to odd
or vice versa. This is done by altering the target object for the sequence
methods in a dynamic proxy when the value "flips". Hence, the implementation of
the sequence methods in effect changes. This imitates dynamic inheritance as
described by Gamma et al. as the means to change the internal state [Gamma95, p.309].
Nested Class Summary | |
---|---|
static class |
StepSequence.Factory
A factory to create StepSequence instances. |
Nested classes/interfaces inherited from interface dk.rode.thesis.meta.model.Sequence |
---|
Sequence.State |
Method Summary |
---|
Methods inherited from interface dk.rode.thesis.meta.model.Sequence |
---|
bounded, consistent, copy, current, next, reset, state, unique |
Methods inherited from interface dk.rode.thesis.strategy.Stringable |
---|
getStringablePolicy, toString |
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |