Hi,
very embarrassingly, our "we keep the traffic alive" project seems turning "we keep the traffic from alive". The design is finished, now comes the problem of
java implementation.
The whole system can be separated in 3 parts. I am doing the device part (state
pattern) and cooperating in the controling part. In my pattern, every crossing has several traffic lights and every traffic light has its unique sequence of states, according to the signals it receives from the control
unit. This pattern alone is not that difficult to implement.
The controling unit is receiving signals from three sources: Timer( TimerListener), detectors( DetectorListener). Detectors are built in every traffic light, and defect reporter( ErrorListener ). According to the singals it receives, it gives signals to traffic lights to turn red, green or yellow. Here we are supposed to use the observer pattern.
We are not quite clear about how should we compose these two patterns. How does the communication work here?
And, we have 5 crossings, these 5 crossings are very different from each other. the system is supposed to run concurrently.
Any suggestion? Thanks in advance.
Regards,
Ellen
[ May 30, 2003: Message edited by: Ellen Zhao ]