Do domains break MVC? (Was: Domain TRAP)

From: [at]} <Wojtek>
Date: Fri, 14 Sep 2001 12:41:41 -0400 (EDT)

Dominik:

I just verified that changing the copy to deep in CopyFromModelView
removes the trap. This is in agreement with a sentence from the Stores
documentation:
 "If two stores have to be joined and precondition 22 is not met, then
  a deep copy of one of the two stores has to be generated using CopyOf."

At this point I am bothered that my original design objectives cannot be
met in BlackBox at all! Based on my previous Oberon System experience
I expected to be able to display a live copy of the same data in many
viewers simultaneously. This is what the MVC is all about and there
are tons of Oberon literature on this subject. However, under BlackBox
I cannot Join the same derivative of Stores.Store to several different
models, because each model has its own domain, and the precondition 22
will get violated. This means that I either have to make a deep copy
of my data (what I hesitate to do because the deep copy is not a live
copy), or I have to make a fresh viewer each time, which is also not
ideal because this means I cannot simply "drag and drop" my live data
onto an existing viewer.

Thus it looks to me like the OuS has quietly discontinued MVC as
we know it from Oberon System, without really saying so. The MVC
gets killed by precondition 22, and by a fine print as cited above.
It is true that the restrictions imposed by domains are all written
somewhere in the docu, but I had to get bitten by many traps
to really appreciate the dimension of the change I have to make
in my design.

Regards,

Wojtek Skulski skulski{([at]})nowhere.xy
On Fri, 14 Sep 2001, Wojtek Skulski wrote:

> Dear Dominik:
>
> thank you for a prompt answer. As you can recall, I had
> problems with domains in the past. Now I am hitting the obstacles
> again. I am calling the Stores.Join(view,view.model) when initializing
> my view. I can save the view when it is opened in its own window.
> This means that both the view and its model have domains properly
> initialized, and the domains are the same.
>
> I can paste the copy of such a view into a text
> (using CTRL-A, CTRL-C, CTRL-V). The copy looks just fine. The trap
> happens when I try to save this text. This probably means that
> the model has kept its domain. Now, I admit I am doing a shallow copy
> in CopyFromModelView, as follows:
>
> dst.model := source.ThisModel() (GrModels.Model); (* shallow copy *)
>
> I am doing this on purpose, because I want my view to display
> a live copy of the model data. Your own doocumentation explicitely says
> that it is legal for many views to render the same model. This is what
> I want to achieve. If I made a deep copy, then I would display a frozen
> snapshot, not a live copy.
>
> If my understanding is correct, then I have hit a real limitation
> of the BlackBox design. Namely, it is not possible to display
> many views of the SAME model and to embed them in texts. The domain
> conflict HAS to occur, because a shallow copy of the model keeps
> its domain.
>
> I cannot use Info->View State because this menu item is greyed all the
> time.
>
> Wojtek Skulski skulski{([at]})nowhere.xy
> On Fri, 14 Sep 2001, Dominik Gruntz wrote:
>
> > I assume that the view of your design (which you embed in a text)
> > contains its own model, and this model (another store) is not joined
> > with the view itself (Stores.Join). When the view is embedded in
> > the text, it is assigned to the text's domain. Upon externalization,
> > WriteStore checks, whether all stores belong to the same domain,
> > otherwise it traps.
> >
> > With Info->View State you could check yourself, which store
> > referenced by your view does not belong to a domain.
> >
> > - Dominik
> >
> >
> >
> > ----- Original Message -----
> > From: Wojtek Skulski <skulski{([at]})nowhere.xy
> > To: BlackBox <blackbox{([at]})nowhere.xy
> > Cc: Wojtek Skulski <skulski{([at]})nowhere.xy
> > Sent: Freitag, 14. September 2001 08:13
> > Subject: Domain TRAP
> >
> >
> > > Hello:
> > >
> > > I would appreciate some enlighting comments
> > > concerning the domains in BB. Here is the problem:
> > >
> > > TRAP 21 (precondition violated)
> > >
> > > Stores.Writer.WriteStore [00002884H]
> > >
> > > The Stores.odc explain, that:
> > >
> > > "PROCEDURE (VAR wr: Writer) WriteStore (x: Store)
> > > All stores that are written using the same writer must
> > > have the identical domain."
> > >
> > > Precondition which is violated:
> > > 21 x # NIL => writer must have no domain,
> > > or the same one as x (and as all previously written stores)
> > >
> > > How can this happen? I am embedding a few views of my design in a text,
> > > they look healthy and just fine. But then, when I try to save
> > > this text, the trap happens. I admit I embedded the views by copying
> > > and pasting (using keystrokes CTRL-A, CTRL-C, CTRL-V). This
> > > is a perfectly legal Windows operation and it seems to work
> > > just fine. How could the domains get corrupted?
> > >
> > > I barely dare to whisper that the domains in BB look like
> > > one big headache to me....
> > >
> > > The words of wisdom will be highly appreciated.
> > >
> > > Please send e-mail responses directly to me with a copy
> > > to the mailing list, because I am receiving mailing list
> > > digests once a week.
> > >
> > > Thank you!
> > >
> > >
> > > Wojtek Skulski skulski{([at]})nowhere.xy
> > >
> > > --------------------------------------------
> > >
> > > To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
> > > blackbox-request{([at]})nowhere.xy
> > >
> > > To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
> > >
> > > Send any problem reports or questions related to this email list to the list owner at
> > > owner-blackbox{([at]})nowhere.xy
> > >
> >
> >
>
>

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.


Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
Received on Fri Sep 14 2001 - 16:41:41 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:43 UTC