how to define a shared eStructuralFeatures [message #515093] |
Wed, 17 February 2010 12:04 |
Eclipse User |
|
|
|
Hello everybody,
I define some things as the following:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testcosmos"
nsURI=" http://picoforge.int-evry.fr/projects/cosmos/testcosmos.ecor e" nsPrefix="testcosmos.ecore">
<eClassifiers xsi:type="ecore:EClass" name="Application">
<eStructuralFeatures xsi:type="ecore:EReference" name="messageManager" lowerBound="1"
eType="#//MessageManager" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1"
eType="#//Application"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MessageManager"/>
</ecore:EPackage>
In my meta-model, I have an Application that contains a MessageManager and a lots of applications (upperBound = -1). In fact, when I create a dynamic instance of Application that contains two sub-applications, I want to use MessageManager of supper application for each sub-application.
How I define in my meta-model to do that?
Thanks in advance,
Kinh
|
|
|
Re: how to define a shared eStructuralFeatures [message #515123 is a reply to message #515093] |
Wed, 17 February 2010 09:26  |
Eclipse User |
|
|
|
Hi,
if the subapplication generally contain no Message Manager I would
define an explicit root Application, like an inverse composite pattern.
If sub application CAN contain a messageManager I would overrride the
getMessageManager to check whether there is a messenger and delegate to
the container if not..
Hope this helps
Cheers
Jonas
Cong Kinh NGUYEN wrote:
> Hello everybody,
>
> I define some things as the following:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testcosmos"
> nsURI=" http://picoforge.int-evry.fr/projects/cosmos/testcosmos.ecor e"
> nsPrefix="testcosmos.ecore">
> <eClassifiers xsi:type="ecore:EClass" name="Application">
> <eStructuralFeatures xsi:type="ecore:EReference"
> name="messageManager" lowerBound="1"
> eType="#//MessageManager" containment="true"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="applications"
> upperBound="-1"
> eType="#//Application"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="MessageManager"/>
> </ecore:EPackage>
>
> In my meta-model, I have an Application that contains a MessageManager
> and a lots of applications (upperBound = -1). In fact, when I create a
> dynamic instance of Application that contains two sub-applications, I
> want to use MessageManager of supper application for each sub-application.
>
> How I define in my meta-model to do that?
>
> Thanks in advance,
> Kinh
|
|
|
Powered by
FUDForum. Page generated in 0.05165 seconds