Re: sequence diagram for observer pattern




responding to all

Actually the intent of representing the behavior of observer pattern
using sequence diagram was to mine instances of Design
Patterns(observer in this case) from some legacy code...the constraint
that i put on the behavior is that once the state of Subject
changes..then all its Observers are informed of this change..and each
Observer is sent the update message only ONCE for a single change of
state in the subject...To achieve this i can wrap each update message
inside an "alt" structure and further put this entire structure inside
a "loop" block.....this scheme basically takes care of the order
independence problem...however with the above schema we can have
observers being send zero or more update messages.

I would like to know if this is a valid constarint to put on the
behaviour of observer pattern or we can have an observer receiving more
than one update message per state change of subject?

thanks for all the replies

.



Relevant Pages

  • Re: sequence diagram for observer pattern
    ... state in the subject...To achieve this i can wrap each update message ... behaviour of observer pattern or we can have an observer receiving more ... As a practical matter I think the number of notifications a given Observer gets per source state change depends upon the source, ...
    (comp.object)
  • Re: Observer pattern limitations
    ... objects to need to cache the results of calculations. ... However, you're talking about the observer pattern, not about caches. ... dependents into memory - even dependents that aren't themselves being ...
    (comp.object)
  • Re: Observer pattern limitations
    ... Basically it is to throw away the observer pattern ... (unless you're doing a trivial problem that (provably) ... Over-use of observer leads to the problems you so well described. ... Abstraction is a double-edged sword. ...
    (comp.object)
  • Observer pattern limitations
    ... objects to need to cache the results of calculations. ... common use case for the observer pattern. ... an observer decides to attach or detach to/from the subject. ...
    (comp.object)
  • Re: Observer pattern with MOP
    ... I am looking for a way to implement the observer pattern in CL, ... thought the MOP would be useful for it. ... uninteresting notifications that it has to discard (leading to performance ...
    (comp.lang.lisp)