[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objects, processes, and encapsulation



Gerard, Ian, Tom, Peter, others...

The most important design pattern in OO is the
     Model-View
     or
     Model-Observer
     or
     Model-View-Controller
     or
     Representation-Presentation-Access

Design Pattern (these are all pretty much the same in different contexts).

The Model is a Class that is primarily a data class. It represents the
"world" that is manipulated.

Views/Observers/Controllers/... are objects that can change (manipulate)
the model, and that react to changes in the Model (for example by
redrawing the GUI representation of the Model in the screen).

Typically, multiple View-Objects are related to the same Model Object.

     Model --(ChangeNotification)--> View
          <-(ChangeOperation)------

In OO:
     * The ChangeOperation is a method call, typically
       returning a result of the ChangeOperation.
     * The ChangeNotification is a typically callback
      (both method calls)

Gerards solution with the ALT does not work very well:
     The View should always be able to receive the
     ChangeNotification

I'm not sure whether Ians suggestions work: both model
     and view must be able to initiate the communication
     at some arbitrary point in time (in trace :-) )

In my opinion, the problem should be solved by making
the ChangeNotification and Asynchronous channel.  For
example, an OverwritingOnePlaceBufferChannel.

What do you think?

     Marcel

Marcel Boosten           | Philips Medical Systems
System Designer 3DRA          | Room QJ1309
System Design & Image Quality | P.O. Box 10000
Cardio Vascular Development   | 5680 DA  Best
Marcel.Boosten@xxxxxxxxxxx    | The Netherlands
Phone: +31-40-27-69019        | Fax: +31-40-27-65650