S
Steven P
Hi,
In my project I have a timer-driven state machine. The timer object
are in the form. Update of controls like edit, label will be executed
in some states. The state machine is in a seperate class, and will be
called when time-out event comes. The sequence is timeout->state
machine->update form.
I am now thinking using observer pattern to let the state machine
class update the form. One thing I am not so sure is, the real trigger
actually comes from the form, so the form is not only the observer of
the event, but also has the role of the subject. This seems violating
the decouple principle in using the observer pattern.
Have anyone had the same problem? Any idea will be appreciated
Steven
In my project I have a timer-driven state machine. The timer object
are in the form. Update of controls like edit, label will be executed
in some states. The state machine is in a seperate class, and will be
called when time-out event comes. The sequence is timeout->state
machine->update form.
I am now thinking using observer pattern to let the state machine
class update the form. One thing I am not so sure is, the real trigger
actually comes from the form, so the form is not only the observer of
the event, but also has the role of the subject. This seems violating
the decouple principle in using the observer pattern.
Have anyone had the same problem? Any idea will be appreciated
Steven