Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extending an emf model & the generated editor?
Extending an emf model & the generated editor? [message #391305] Wed, 23 February 2005 21:22 Go to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
I have an emf model that extends another emf model, and the generated
editor for the extending model does not behave as I would like.

My base emf model contains two classes: Parent and Child. The Parent
class has an EList of Child classes (children). My second emf model
contains a single class: NeedyChild that extends (is a specialization
of) Child. Given a Parent, i should be able to add instances of Child
or NeedyChild to it's list of children.

As expected the editor for the base project allows me to create a
Parent and instances of Child, but not instances of NeedyChild.

The generated editor for the project that contains the model with
NeedyChild does not allow me to create a Parent, only NeedyChild.

My workaround was to create a class in the same model as NeedyChild
called PatientParent that extends Parent. When I use the generated
editor, I can create an instance of PatientParent and add instances of
Child and NeedyChild. From a modeling point of view, PatientParent is
not needed as it provides no additional information.

Is there something simple I'm missing with the generated editor that
would allow me to create elements in a base model without having to
extend the top level element as I have done with PatientParent? I'd
really like to simply create an instance of Parent and be able to add
instances of Child or NeedyChild.

Bryan
Re: Extending an emf model & the generated editor? [message #391309 is a reply to message #391305] Wed, 23 February 2005 23:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Bryan,

Yeah, I've heard this problem described before, but never quite so well,
and with such good class names. ;-) The last time two times I heard it
I asked the folks to open a bugzilla feature request, but there still
isn't one so I'll ask again.

I'm not sure how we will fix this. It's like you would need to
generated an extended item provider adapter for Parent that would know
about NeedyChild. Your approach of defining a PatientParent effectively
forced this to happen, with the very unfortunate side effect of
introducing a new model object.


Bryan Hunt wrote:

> I have an emf model that extends another emf model, and the generated
> editor for the extending model does not behave as I would like.
>
> My base emf model contains two classes: Parent and Child. The Parent
> class has an EList of Child classes (children). My second emf model
> contains a single class: NeedyChild that extends (is a specialization
> of) Child. Given a Parent, i should be able to add instances of Child
> or NeedyChild to it's list of children.
>
> As expected the editor for the base project allows me to create a
> Parent and instances of Child, but not instances of NeedyChild.
>
> The generated editor for the project that contains the model with
> NeedyChild does not allow me to create a Parent, only NeedyChild.
>
> My workaround was to create a class in the same model as NeedyChild
> called PatientParent that extends Parent. When I use the generated
> editor, I can create an instance of PatientParent and add instances of
> Child and NeedyChild. From a modeling point of view, PatientParent is
> not needed as it provides no additional information.
>
> Is there something simple I'm missing with the generated editor that
> would allow me to create elements in a base model without having to
> extend the top level element as I have done with PatientParent? I'd
> really like to simply create an instance of Parent and be able to add
> instances of Child or NeedyChild.
>
> Bryan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extending an emf model & the generated editor? [message #391321 is a reply to message #391309] Thu, 24 February 2005 15:42 Go to previous messageGo to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
Ask and ye shall receive:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=86481

On 2005-02-23 17:00:54 -0600, Ed Merks <merks@ca.ibm.com> said:

> Yeah, I've heard this problem described before, but never quite so
> well, and with such good class names. ;-) The last time two times I
> heard it I asked the folks to open a bugzilla feature request, but
> there still isn't one so I'll ask again.
Re: Extending an emf model &amp; the generated editor? [message #758930 is a reply to message #391321] Fri, 25 November 2011 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Am 24.02.2005 16:42, schrieb Bryan Hunt:
> Ask and ye shall receive:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=86481
>
> On 2005-02-23 17:00:54 -0600, Ed Merks <merks@ca.ibm.com> said:
>
>> Yeah, I've heard this problem described before, but never quite so
>> well, and with such good class names. ;-) The last time two times I
>> heard it I asked the folks to open a bugzilla feature request, but
>> there still isn't one so I'll ask again.
>
I had exactly the same problem, so I searched for something like
"Extending an emf model" and "generated editor" and found this
message...and was of course completely on the wrong track - took some
time to find out that this is solved since 2008 via "Child Creation
Extenders" and "Extensible Provider Factory"
- Just in case someone stumbles across this post

Thomas
Re: Extending an emf model &amp; the generated editor? [message #758937 is a reply to message #758930] Fri, 25 November 2011 10:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This should solve the problem:
http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html

On 25/11/2011 11:37 AM, Thomas Forster wrote:
> Am 24.02.2005 16:42, schrieb Bryan Hunt:
>> Ask and ye shall receive:
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=86481
>>
>> On 2005-02-23 17:00:54 -0600, Ed Merks <merks@ca.ibm.com> said:
>>
>>> Yeah, I've heard this problem described before, but never quite so
>>> well, and with such good class names. ;-) The last time two times I
>>> heard it I asked the folks to open a bugzilla feature request, but
>>> there still isn't one so I'll ask again.
>>
> I had exactly the same problem, so I searched for something like
> "Extending an emf model" and "generated editor" and found this
> message...and was of course completely on the wrong track - took some
> time to find out that this is solved since 2008 via "Child Creation
> Extenders" and "Extensible Provider Factory"
> - Just in case someone stumbles across this post
>
> Thomas
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extending an emf model &amp; the generated editor? [message #759021 is a reply to message #758937] Fri, 25 November 2011 15:47 Go to previous message
Eclipse UserFriend
Am 25.11.2011 11:48, schrieb Ed Merks:
> roblem, so I searched for something like "Extending an emf model" and
> "generated editor" and found this message...and was of course completely
> on the wrong track - took some time to find out that this is solved
> since 2008 via "Child Creation Extenders" and "Extensible Provider Factory"
> - Just in case someone stumbles across this post

Thanks a lot, that is exactly what I need
Previous Topic:EMF Database Schema: Custom or Generic?
Next Topic:[CDO] clarification on how to delete an object contained in a CDOResource.
Goto Forum:
  


Current Time: Thu Apr 25 07:41:05 GMT 2024

Powered by FUDForum. Page generated in 0.02426 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top