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

dk.rode.thesis.observer
Interface SequenceObserver<A>

Type Parameters:
A - The type of aspect used by this observer.
All Known Subinterfaces:
AspectObservableSequence<O,A,E>, ObservableSequence<O,A,E>
All Known Implementing Classes:
AnnotatedObserversSequence, AnnotatedObserversSequenceDecorator, BirthdayRegistry.RegistryObserver, CorrelatedSequenceObserver, DateSequence, PrintSequenceObserver, SequenceObserversSequence, SequenceObserversSequenceDecorator

@Participant(value="Observer")
public interface SequenceObserver<A>

A sequence observer is an object that is notified when the observable sequence it is attached to changes its aspect value.

Implementation notes:
Sequence observers do not employ parameterised types on the sequence supplied to the notification method because the same observer may be attached to several different types of observable sequences.

Furthermore, the actual type of sequence supplied to the notification method cannot be assumed observable, or even of the type of sequence this observer was attached to; it might be adapted, decorated, composite, or proxied. Hence, several other patterns may be applied in the implementation of this interface.

Author:
Gunni Rode / rode.dk

Method Summary
 void sequenceEvent(Sequence<?> sequence, A aspect)
          Notification method that is invoked when the sequence supplied as sequence has changed its state to state.
 

Method Detail

sequenceEvent

void sequenceEvent(Sequence<?> sequence,
                   A aspect)
Notification method that is invoked when the sequence supplied as sequence has changed its state to state.

The type of sequence is not defined; it cannot be assumed observable, or even of the type this observer was attached to; it might be adapted, decorated, composite, or proxied.

Parameters:
sequence - This sequence; cannot be null.
aspect - The current (new) aspect; cannot be null.
Throws:
NullPointerException - If sequence is null. Nullability of aspect is implementation dependent.

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.