Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ecorediag class instance
ecorediag class instance [message #973576] Tue, 06 November 2012 12:59 Go to next message
Eyal Heinemann is currently offline Eyal Heinemann
Messages: 7
Registered: October 2012
Junior Member
Hi all,

I'm only in my first footsteps so please bear with me.
I have project with some special features.

1. Lets say in the created model I have two classes: Container and TypeA.
Now TypeA object have relation between one another (specifically they can point one to another-unidirectional pointing).
Container has all TypeA objects in a list and also I need him to have two "special" TypeA instances; they are special because they dont point to other TypeA (empty list or even no list property) and some of the other TypeA properties are Constant.

How would you suggest me to model this? is it possible?

Another problem, lets say I have a model and an infrastructure that works with that model, can I bring object from that model into mine without have to bring the entire model scheme?

Thank you

Eyal
Re: ecorediag class instance [message #973616 is a reply to message #973576] Tue, 06 November 2012 13:33 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Eyal,

Comments below.

On 06/11/2012 1:59 PM, Eyal Heinemann wrote:
> Hi all,
>
> I'm only in my first footsteps so please bear with me.
> I have project with some special features.
>
> 1. Lets say in the created model I have two classes: Container and
> TypeA. Now TypeA object have relation between one another
> (specifically they can point one to another-unidirectional pointing).
> Container has all TypeA objects in a list and also I need him to have
> two "special" TypeA instances; they are special because they dont
> point to other TypeA (empty list or even no list property) and some of
> the other TypeA properties are Constant.
>
> How would you suggest me to model this? is it possible?

Certainly there is no way in Ecore to model constants. With respect to
TypeA, you might define a base interface with only operations and define
several subclasses with features whose accessors override those
operations and ones with no overrides for which you manually modify the
Impl class them to return constants. It's not clear if you want the
special instances to be in a list. Perhaps you put them in some
transient derived read-only features that you populate automatically
ContainerImpl's constructor
>
> Another problem, lets say I have a model and an infrastructure that
> works with that model, can I bring object from that model into mine
> without have to bring the entire model scheme?
You can defined wrapper EDataTypes for existing classes (much like
Ecore.ecore does for EDate).
>
> Thank you
>
> Eyal
Previous Topic:Is it not possibile to use instance of eclass as map key?
Next Topic:Creating an own form based editor
Goto Forum:
  


Current Time: Sat Oct 25 20:44:00 GMT 2014

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

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