Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] e4 Model Questions and comments

Hi Tom,

On Thu, Mar 4, 2010 at 5:23 PM, Tom Schindl <tom.schindl@xxxxxxxxxxxxxxx> wrote:
> If I get this right the descriptor is something one uses to contribute a
> Part-Description to through ModelComponent and Part the thing that
> should end up as part of our UI-Workbench-Model.

PartDescriptors serve one purpose -> they  are templates for creating
Parts.  PartDescriptor->Part is the equivalent of
ViewDescriptor->ViewPart in the 3.x world.  PartDescriptors are stored
in a part of the model that's not rendered.  They need to contain
everything necessary to generate the Part so it can be rendered (which
is pretty well every field).

Right now we take the shortcut of simply cloning the PartDescriptor
(which is a Part) so that it can be rendered, but that's simply our
current implementation, not a requirement.

>
> This (IMHO) incorrect extending of Part is also the problem we are
> seeing in ModelComponent which has the following attributes:
>
> PartDescriptorContainer {
>   descriptor: List<PartDescriptor>
> }
>
> ModelComponent extends PartDescriptorContainer {
>   children: List<UIElement>
> }
>
> So because PartDescriptor is a Part I can also contribute it through the
> children-Attribute though this probably not I wanted to do.

Probably not, as it will be rendered :-)

ModelComponent also serves a purpose.  It's supposed to be a loadable
fragment of the model, that we can then apply to the real model (kind
of an extension point for models).

Really what we are trying to do with ModelComponent is to add to the
model instance by merging model fragments into it.  If there's already
a well known EMF way to do this, it would be good to know :-)  I
recently ran into a problem where the model has commands defined, but
I can't use the model fragment to add a menu item because it cannot
resolve the reference to its command ... since that's in the already
loaded model instance.

Later,
PW

-- 
Paul Webster
Hi floor.  Make me a sammich! - GIR


Back to the top