Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Using UML2 GenModel with a simple eCore model to handle 'subsets'
Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470134] Wed, 07 February 2007 14:20 Go to next message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------010802000906090906080807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi All,

I've to create a metamodel with eCore. eCore is fine for my needs, but
now I get into trouble: I've a composition that is a subset of another
(see attached file). I've seen that there is a annotation named
'subsets' in UML.ecore. I would like to take advantage of the GenModel
that use it, but I don't know how to use it ? I create a genmodel from
my ecore model but I don't see where to make reference to UML.GenModel.

Thanks for your help !
Sylvain

--------------010802000906090906080807
Content-Type: image/png;
name="My.png"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="My.png"

iVBORw0KGgoAAAANSUhEUgAAAXQAAADaCAYAAAC2Arl5AAAAIGNIUk0AAHom AACAhAAA+gAA
AIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAEZ0FNQQAAsY58+1GTAAAAAXNS R0IArs4c6QAA
AAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAH+ZJREFU eNrtnQlwVFW6
x7+EXVmGbYS4gMCA+wZRkQEVfIo83xC3GpQnqyIzKIgi8IA4gxFhVBhLdhTB EQaUkSoo5pVa
WCyKgA4IKhEQcFhC4BkBEWSRJC//Izc2IZ109tt9f7+qrqT7dk66b5/+3+98 24nLzsEAACDq
iecUAAAg6AAAgKADAACCDgAACDoAAIIOAAAIOgAAIOgAAICgAwAg6AAAgKAD AACCDgAACDoA
ACDoAAAIOgAAIOgAAICgAwAAgg4AgKADAACCDgAACDoAACDoAAAIOgAAIOgA AICgAwAAgg4Q
Y8TFxeX7OwCCDhBlZGdncxKgRFTmFECsc+rUKRsyZIi99tprlpWVZZ07d7aF Cxee8bjo06eP
TZgwwSpXruws5EGDBtmMGTOsTp06NnXqVNuyZYuNHTvWatSoYbNmzXLj6HkT J0608ePH2/79
++322293x+rWrVvg+IsXL7YBAwbYt99+a3fffbfNmzfPjSVR96xz76cn9Ckp KZaamur+/sSJ
EzZ58mRr2LAhHzAg6BAcJITVq1e3Q4cOOTH0GDVqlDVt2tQOHz7s7k+bNs1G jBhhL7zwgrvf
uHFjd2z16tXWqVMnN05GRoa736tXL9u+fbt73tGjR23jxo1Ws2ZNmzJlio0c OdL9LGh8/f2a
NWusRYsWNmnSpLMsdU/cPXQh0cVIwi90QRo+fLjNnDmTDxhwuUBwkIX87LPP niHm4s0337TH
HnvM4uPj3e3hhx92j3kMGzbM/U379u2dmIbe37lz5xnPq127thujf//+NmfO nELHl5Wflpbm
Hh84cGCh70EXg8GDB+feT0pKsgULFvDhAhY6BIu9e/da1apV8308VOT1nO++ +y7fMTIzMwu8
n/uFyhnv+PHjhY4/f/58e+aZZ6xbt242btw46927d4HvYdeuXc71A4CgQ6Bp 1KiRs7BlDed9
XH5uT3RPnjzpfN8lQeN5YxQ0vqz8ZcuW2e7du61Vq1aFCnpCQoJ7bt73ABAK swNinoceesje
euutsx7v2bOnvfzyy07sdZPfW48VlS+//NL91BhvvPGGde/evdDxR48ebUeO HHH+9/r16581
poR/69atufflylFAVRcIoeBo3759+XABCx2ChfznQ4cOdQIoYe3SpYsLKj73 3HP25JNP2jnn
nOOe169fP3vppZeKPL6yYVatWuUscfnJ5UIRBY2/Y8cOa9CggRPz6dOnnzWm smauu+4697uE
Pzk52QVGmzdvbunp6ZaYmOiyaQBCicsm+RWg+F+gPNkoABUJLheAElCtWjVO AiDoALGAl9EC
gKADAACCDgAACDoAAIIOAAAIOgAAIOgAABAJVIpCmbBo0SJOQjnTtWtXTgKC DoDAcAGFWACX
CwAAgg4AAAg6AAAg6AAAgKADACDoAACAoAMAAIIOAAAIOgAAgg4AAAg6AAAg 6AAAgKADAACC
DgCAoAMAAIIOAAAIOg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29EryXcdwP8ZqFnxRf7 uHzACqg8/vjj
bvJpGzAFdcRzzz1nTz75ZK6fUf5vLwugOCi/V9H8J554wmWOKDtAecDi9ddf dwEcTWpVXD79
9NNhx9HfqSGX96UMRRkF2hhahDY5Ku33Aj6x0H0+95UNs2rVKmeJy0/u5bgX d3wZOrroqKhL
yQWK5ShzJhLCfTegjAyX7AhD0MrFDe1nMbhfBxs7cfpp6+f0gyF+xOGPP2p/ nbHSV29WVomC
Oe+88469/fbbvv1Q8p7rsiI0jU3nRmlvymCI1fQ5D035xYsX24ABA1xw++67 787N4Ij2ue/3
rJLymttY6EUkMzvenvrjH8Ier+Qjf5uKbiQq8gFKbKZPn84nf1ocFZxTT+zQ YFkQ0uf0OrUX
rFZmyoSKlblfUf1tIMoF/ZVXl0fNmwxN6YJfkIWs3Pa8jb2UyqZz5gXBtGzX RdETXM/lFJo+
593Pmz7nIT+sKlsl6IWNrwuEh9LgPD+vhF/NyjyUPidh9gQ93N/lh1YTipuo sGfgwIExM/ej
vYcRVJCgQ/SjNLb8dlwKQvqcSu+feeYZ69atm/Mx55d1AoCgQ9SgNLb8UjqD kD6n1YQ2j9Z4
rVq1QtAhJiCxNMA89NBD9tZbb531eBDS51QkpqwL+fnr16/PZAAsdIhu1ChK bVwlihLWLl26
uEBjENLnVEGsdgoSc4LkECsUO20Ryo5YONex1JSJuc+5jBZwuUCZQPocAIIO MQLpcwAIOgAA
IOgAAMGmSFkuefdWBAgKzH2IKUEnMg1BhbkP0QIuFwAABB0AABB0AABA0AEA AEEHAEDQAQAA
QQcAAAQdAAAQdAAABB0AABB0AABA0AEAAEEHAAAEHQAAQQcAAAQdAAAQdAAA QNABAILA/wPC
tzU3GBYgqQAAAABJRU5ErkJggg==
--------------010802000906090906080807--
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470138 is a reply to message #470134] Wed, 07 February 2007 15:43 Go to previous messageGo to next message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi again,

To be more precise, here's a java sample of what I want to do in eCore:

// main class Element, root for the others
public abstract class Element
{
private List<Element> composites = new ArrayList<Element>();
public List<Element> getComposites() {
return composites;
}
public void setComposites(List<Element> composites) {
this.composites = composites;
}
}

// class Component, a Element
public class Component extends Element { }

// class configuration containing Element that are only instanceof
Components
public class Configuration extends Element
{
public List<Component> getComponents() {
List<Component> result = new ArrayList<Component>();
for (Element composite : this.getComposites()) {
if (composite instanceof Component) result.add((Component)composite);
}
return result;
}
public void addComponent(Component c) {
this.getComposites().add(c);
}
}

This way the component list is clearly a subset of composites...
Thanks for your help !

Sylvain


Sylvain a écrit :
> Hi All,
>
> I've to create a metamodel with eCore. eCore is fine for my needs, but
> now I get into trouble: I've a composition that is a subset of another
> (see attached file). I've seen that there is a annotation named
> 'subsets' in UML.ecore. I would like to take advantage of the GenModel
> that use it, but I don't know how to use it ? I create a genmodel from
> my ecore model but I don't see where to make reference to UML.GenModel.
>
> Thanks for your help !
> Sylvain
>
> ------------------------------------------------------------ ------------
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470145 is a reply to message #470138] Wed, 07 February 2007 22:08 Go to previous messageGo to next message
Tas Frangoullides is currently offline Tas FrangoullidesFriend
Messages: 195
Registered: July 2009
Senior Member
Hi Sylvain,

UML2 allows you to model subsetting through the subsettedProperty
attribute on Property.

If you define your model in UML2, and use this model as the source for
creating your genModel, you can get a genmodel that generates the code you
require. During the import process you will be presented with a dialog
that lets you choose to process property subsetting.

IF you already have your model defined in ecore you could create an
initial UML model by converting from ecore to UML (Convert to UML in the
Ecore Editor menu).

Hope that helps,

Tas.


Sylvain wrote:

> Hi again,

> To be more precise, here's a java sample of what I want to do in eCore:

> // main class Element, root for the others
> public abstract class Element
> {
> private List<Element> composites = new ArrayList<Element>();
> public List<Element> getComposites() {
> return composites;
> }
> public void setComposites(List<Element> composites) {
> this.composites = composites;
> }
> }

> // class Component, a Element
> public class Component extends Element { }

> // class configuration containing Element that are only instanceof
> Components
> public class Configuration extends Element
> {
> public List<Component> getComponents() {
> List<Component> result = new ArrayList<Component>();
> for (Element composite : this.getComposites()) {
> if (composite instanceof Component) result.add((Component)composite);
> }
> return result;
> }
> public void addComponent(Component c) {
> this.getComposites().add(c);
> }
> }

> This way the component list is clearly a subset of composites...
> Thanks for your help !

> Sylvain


> Sylvain a écrit :
>> Hi All,
>>
>> I've to create a metamodel with eCore. eCore is fine for my needs, but
>> now I get into trouble: I've a composition that is a subset of another
>> (see attached file). I've seen that there is a annotation named
>> 'subsets' in UML.ecore. I would like to take advantage of the GenModel
>> that use it, but I don't know how to use it ? I create a genmodel from
>> my ecore model but I don't see where to make reference to UML.GenModel.
>>
>> Thanks for your help !
>> Sylvain
>>
>> ------------------------------------------------------------ ------------
>>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470155 is a reply to message #470145] Thu, 08 February 2007 01:53 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
.... there are some draft documents that explain subsetting see the one under
"Extending UML doc"...

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

Hopefully they will be of some use. Please add comments or suggestions for
other topics you would like to see covered.

Cheers,
- James.


"Tas Frangoullides" <tas.frangoullides@barclaysglobal.com> wrote in message
news:2d255c2527f5a7a6f37faad04fd62254$1@www.eclipse.org...
> Hi Sylvain,
>
> UML2 allows you to model subsetting through the subsettedProperty
> attribute on Property.
>
> If you define your model in UML2, and use this model as the source for
> creating your genModel, you can get a genmodel that generates the code you
> require. During the import process you will be presented with a dialog
> that lets you choose to process property subsetting.
>
> IF you already have your model defined in ecore you could create an
> initial UML model by converting from ecore to UML (Convert to UML in the
> Ecore Editor menu).
>
> Hope that helps,
>
> Tas.
>
>
> Sylvain wrote:
>
>> Hi again,
>
>> To be more precise, here's a java sample of what I want to do in eCore:
>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> } }
>
>> // class Component, a Element
>> public class Component extends Element { }
>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component) result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>
>> Sylvain
>
>
>> Sylvain a
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470161 is a reply to message #470138] Thu, 08 February 2007 13:54 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Sylvain,

Take a look at the implementation of PackageImpl#getNestedPackages() or
PackageImpl#getOwnedTypes(). There you'll see how a
DerivedSubsetEObjectEList can be used to implement a list that subsbets
another list by restricting its type, much the same as you are looking to
do. Currently, however, the UML2 code generator does not generate this code,
so you'll have to add it by hand.

Kenn

"Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
news:eqcs2e$t55$1@utils.eclipse.org...
> Hi again,
>
> To be more precise, here's a java sample of what I want to do in eCore:
>
> // main class Element, root for the others
> public abstract class Element
> {
> private List<Element> composites = new ArrayList<Element>();
> public List<Element> getComposites() {
> return composites;
> }
> public void setComposites(List<Element> composites) {
> this.composites = composites;
> } }
>
> // class Component, a Element
> public class Component extends Element { }
>
> // class configuration containing Element that are only instanceof
> Components
> public class Configuration extends Element
> {
> public List<Component> getComponents() {
> List<Component> result = new ArrayList<Component>();
> for (Element composite : this.getComposites()) {
> if (composite instanceof Component) result.add((Component)composite);
> }
> return result;
> }
> public void addComponent(Component c) {
> this.getComposites().add(c);
> }
> }
>
> This way the component list is clearly a subset of composites...
> Thanks for your help !
>
> Sylvain
>
>
> Sylvain a
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470169 is a reply to message #470145] Thu, 08 February 2007 15:50 Go to previous messageGo to next message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi,

Ok I've try your solution to translate eCore to UML then create
genModel, it seems to work ;-) I have a eCore model with "subsets"
annotation, the converter generate a lots of UML elements form it and
finally I generated the java classes. I don't need all UML stuffs, just
"subsets"... Is there really no way to bypass the UML conversion step ?

BTW thanks for your useful help ;-)

Sylvain

Tas Frangoullides a écrit :
> Hi Sylvain,
>
> UML2 allows you to model subsetting through the subsettedProperty
> attribute on Property.
>
> If you define your model in UML2, and use this model as the source for
> creating your genModel, you can get a genmodel that generates the code
> you require. During the import process you will be presented with a
> dialog that lets you choose to process property subsetting.
>
> IF you already have your model defined in ecore you could create an
> initial UML model by converting from ecore to UML (Convert to UML in the
> Ecore Editor menu).
>
> Hope that helps,
>
> Tas.
>
>
> Sylvain wrote:
>
>> Hi again,
>
>> To be more precise, here's a java sample of what I want to do in eCore:
>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> }
>> }
>
>> // class Component, a Element
>> public class Component extends Element { }
>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component)
>> result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>
>> Sylvain
>
>
>> Sylvain a écrit :
>>> Hi All,
>>>
>>> I've to create a metamodel with eCore. eCore is fine for my needs,
>>> but now I get into trouble: I've a composition that is a subset of
>>> another (see attached file). I've seen that there is a annotation
>>> named 'subsets' in UML.ecore. I would like to take advantage of the
>>> GenModel that use it, but I don't know how to use it ? I create a
>>> genmodel from my ecore model but I don't see where to make reference
>>> to UML.GenModel.
>>>
>>> Thanks for your help !
>>> Sylvain
>>>
>>> ------------------------------------------------------------ ------------
>>>
>
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470205 is a reply to message #470161] Thu, 08 February 2007 15:59 Go to previous messageGo to next message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi Kenn,

I will try this, in order to keep a full eCore model...

Sylvain

Kenn Hussey a écrit :
> Sylvain,
>
> Take a look at the implementation of PackageImpl#getNestedPackages() or
> PackageImpl#getOwnedTypes(). There you'll see how a
> DerivedSubsetEObjectEList can be used to implement a list that subsbets
> another list by restricting its type, much the same as you are looking to
> do. Currently, however, the UML2 code generator does not generate this code,
> so you'll have to add it by hand.
>
> Kenn
>
> "Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
> news:eqcs2e$t55$1@utils.eclipse.org...
>> Hi again,
>>
>> To be more precise, here's a java sample of what I want to do in eCore:
>>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> } }
>>
>> // class Component, a Element
>> public class Component extends Element { }
>>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component) result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>>
>> Sylvain
>>
>>
>> Sylvain a écrit :
>>> Hi All,
>>>
>>> I've to create a metamodel with eCore. eCore is fine for my needs, but
>>> now I get into trouble: I've a composition that is a subset of another
>>> (see attached file). I've seen that there is a annotation named 'subsets'
>>> in UML.ecore. I would like to take advantage of the GenModel that use it,
>>> but I don't know how to use it ? I create a genmodel from my ecore model
>>> but I don't see where to make reference to UML.GenModel.
>>>
>>> Thanks for your help !
>>> Sylvain
>>>
>>> ------------------------------------------------------------ ------------
>>>
>
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #470228 is a reply to message #470205] Fri, 09 February 2007 11:17 Go to previous message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi Kenn,

Your solution works well, but everything gets harder when I had a
relation one-to-one between my component and my configuration that is
another subset of the main "composite" relation: this relation give a
class attribute after code generation, but in fact i wanted that this
attribute is the only elements in my "composite" collection.

I think I will find a workaround to this problem: my composite become a
"derived" relation and I will implements the "getComposites()" by hand.

Sylvain

Sylvain a écrit :
> Hi Kenn,
>
> I will try this, in order to keep a full eCore model...
>
> Sylvain
>
> Kenn Hussey a écrit :
>> Sylvain,
>>
>> Take a look at the implementation of PackageImpl#getNestedPackages()
>> or PackageImpl#getOwnedTypes(). There you'll see how a
>> DerivedSubsetEObjectEList can be used to implement a list that
>> subsbets another list by restricting its type, much the same as you
>> are looking to do. Currently, however, the UML2 code generator does
>> not generate this code, so you'll have to add it by hand.
>>
>> Kenn
>>
>> "Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
>> news:eqcs2e$t55$1@utils.eclipse.org...
>>> Hi again,
>>>
>>> To be more precise, here's a java sample of what I want to do in eCore:
>>>
>>> // main class Element, root for the others
>>> public abstract class Element
>>> {
>>> private List<Element> composites = new ArrayList<Element>();
>>> public List<Element> getComposites() {
>>> return composites;
>>> }
>>> public void setComposites(List<Element> composites) {
>>> this.composites = composites;
>>> } }
>>>
>>> // class Component, a Element
>>> public class Component extends Element { }
>>>
>>> // class configuration containing Element that are only instanceof
>>> Components
>>> public class Configuration extends Element
>>> {
>>> public List<Component> getComponents() {
>>> List<Component> result = new ArrayList<Component>();
>>> for (Element composite : this.getComposites()) {
>>> if (composite instanceof Component) result.add((Component)composite);
>>> }
>>> return result;
>>> }
>>> public void addComponent(Component c) {
>>> this.getComposites().add(c);
>>> }
>>> }
>>>
>>> This way the component list is clearly a subset of composites...
>>> Thanks for your help !
>>>
>>> Sylvain
>>>
>>>
>>> Sylvain a écrit :
>>>> Hi All,
>>>>
>>>> I've to create a metamodel with eCore. eCore is fine for my needs,
>>>> but now I get into trouble: I've a composition that is a subset of
>>>> another (see attached file). I've seen that there is a annotation
>>>> named 'subsets' in UML.ecore. I would like to take advantage of the
>>>> GenModel that use it, but I don't know how to use it ? I create a
>>>> genmodel from my ecore model but I don't see where to make reference
>>>> to UML.GenModel.
>>>>
>>>> Thanks for your help !
>>>> Sylvain
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>>
>>
>>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583053 is a reply to message #470134] Wed, 07 February 2007 15:43 Go to previous message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi again,

To be more precise, here's a java sample of what I want to do in eCore:

// main class Element, root for the others
public abstract class Element
{
private List<Element> composites = new ArrayList<Element>();
public List<Element> getComposites() {
return composites;
}
public void setComposites(List<Element> composites) {
this.composites = composites;
}
}

// class Component, a Element
public class Component extends Element { }

// class configuration containing Element that are only instanceof
Components
public class Configuration extends Element
{
public List<Component> getComponents() {
List<Component> result = new ArrayList<Component>();
for (Element composite : this.getComposites()) {
if (composite instanceof Component) result.add((Component)composite);
}
return result;
}
public void addComponent(Component c) {
this.getComposites().add(c);
}
}

This way the component list is clearly a subset of composites...
Thanks for your help !

Sylvain


Sylvain a écrit :
> Hi All,
>
> I've to create a metamodel with eCore. eCore is fine for my needs, but
> now I get into trouble: I've a composition that is a subset of another
> (see attached file). I've seen that there is a annotation named
> 'subsets' in UML.ecore. I would like to take advantage of the GenModel
> that use it, but I don't know how to use it ? I create a genmodel from
> my ecore model but I don't see where to make reference to UML.GenModel.
>
> Thanks for your help !
> Sylvain
>
> ------------------------------------------------------------ ------------
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583105 is a reply to message #470138] Wed, 07 February 2007 22:08 Go to previous message
Tas Frangoullides is currently offline Tas FrangoullidesFriend
Messages: 195
Registered: July 2009
Senior Member
Hi Sylvain,

UML2 allows you to model subsetting through the subsettedProperty
attribute on Property.

If you define your model in UML2, and use this model as the source for
creating your genModel, you can get a genmodel that generates the code you
require. During the import process you will be presented with a dialog
that lets you choose to process property subsetting.

IF you already have your model defined in ecore you could create an
initial UML model by converting from ecore to UML (Convert to UML in the
Ecore Editor menu).

Hope that helps,

Tas.


Sylvain wrote:

> Hi again,

> To be more precise, here's a java sample of what I want to do in eCore:

> // main class Element, root for the others
> public abstract class Element
> {
> private List<Element> composites = new ArrayList<Element>();
> public List<Element> getComposites() {
> return composites;
> }
> public void setComposites(List<Element> composites) {
> this.composites = composites;
> }
> }

> // class Component, a Element
> public class Component extends Element { }

> // class configuration containing Element that are only instanceof
> Components
> public class Configuration extends Element
> {
> public List<Component> getComponents() {
> List<Component> result = new ArrayList<Component>();
> for (Element composite : this.getComposites()) {
> if (composite instanceof Component) result.add((Component)composite);
> }
> return result;
> }
> public void addComponent(Component c) {
> this.getComposites().add(c);
> }
> }

> This way the component list is clearly a subset of composites...
> Thanks for your help !

> Sylvain


> Sylvain a écrit :
>> Hi All,
>>
>> I've to create a metamodel with eCore. eCore is fine for my needs, but
>> now I get into trouble: I've a composition that is a subset of another
>> (see attached file). I've seen that there is a annotation named
>> 'subsets' in UML.ecore. I would like to take advantage of the GenModel
>> that use it, but I don't know how to use it ? I create a genmodel from
>> my ecore model but I don't see where to make reference to UML.GenModel.
>>
>> Thanks for your help !
>> Sylvain
>>
>> ------------------------------------------------------------ ------------
>>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583171 is a reply to message #470145] Thu, 08 February 2007 01:53 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
.... there are some draft documents that explain subsetting see the one under
"Extending UML doc"...

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

Hopefully they will be of some use. Please add comments or suggestions for
other topics you would like to see covered.

Cheers,
- James.


"Tas Frangoullides" <tas.frangoullides@barclaysglobal.com> wrote in message
news:2d255c2527f5a7a6f37faad04fd62254$1@www.eclipse.org...
> Hi Sylvain,
>
> UML2 allows you to model subsetting through the subsettedProperty
> attribute on Property.
>
> If you define your model in UML2, and use this model as the source for
> creating your genModel, you can get a genmodel that generates the code you
> require. During the import process you will be presented with a dialog
> that lets you choose to process property subsetting.
>
> IF you already have your model defined in ecore you could create an
> initial UML model by converting from ecore to UML (Convert to UML in the
> Ecore Editor menu).
>
> Hope that helps,
>
> Tas.
>
>
> Sylvain wrote:
>
>> Hi again,
>
>> To be more precise, here's a java sample of what I want to do in eCore:
>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> } }
>
>> // class Component, a Element
>> public class Component extends Element { }
>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component) result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>
>> Sylvain
>
>
>> Sylvain a
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583211 is a reply to message #470138] Thu, 08 February 2007 13:54 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Sylvain,

Take a look at the implementation of PackageImpl#getNestedPackages() or
PackageImpl#getOwnedTypes(). There you'll see how a
DerivedSubsetEObjectEList can be used to implement a list that subsbets
another list by restricting its type, much the same as you are looking to
do. Currently, however, the UML2 code generator does not generate this code,
so you'll have to add it by hand.

Kenn

"Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
news:eqcs2e$t55$1@utils.eclipse.org...
> Hi again,
>
> To be more precise, here's a java sample of what I want to do in eCore:
>
> // main class Element, root for the others
> public abstract class Element
> {
> private List<Element> composites = new ArrayList<Element>();
> public List<Element> getComposites() {
> return composites;
> }
> public void setComposites(List<Element> composites) {
> this.composites = composites;
> } }
>
> // class Component, a Element
> public class Component extends Element { }
>
> // class configuration containing Element that are only instanceof
> Components
> public class Configuration extends Element
> {
> public List<Component> getComponents() {
> List<Component> result = new ArrayList<Component>();
> for (Element composite : this.getComposites()) {
> if (composite instanceof Component) result.add((Component)composite);
> }
> return result;
> }
> public void addComponent(Component c) {
> this.getComposites().add(c);
> }
> }
>
> This way the component list is clearly a subset of composites...
> Thanks for your help !
>
> Sylvain
>
>
> Sylvain a
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583268 is a reply to message #470145] Thu, 08 February 2007 15:50 Go to previous message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi,

Ok I've try your solution to translate eCore to UML then create
genModel, it seems to work ;-) I have a eCore model with "subsets"
annotation, the converter generate a lots of UML elements form it and
finally I generated the java classes. I don't need all UML stuffs, just
"subsets"... Is there really no way to bypass the UML conversion step ?

BTW thanks for your useful help ;-)

Sylvain

Tas Frangoullides a écrit :
> Hi Sylvain,
>
> UML2 allows you to model subsetting through the subsettedProperty
> attribute on Property.
>
> If you define your model in UML2, and use this model as the source for
> creating your genModel, you can get a genmodel that generates the code
> you require. During the import process you will be presented with a
> dialog that lets you choose to process property subsetting.
>
> IF you already have your model defined in ecore you could create an
> initial UML model by converting from ecore to UML (Convert to UML in the
> Ecore Editor menu).
>
> Hope that helps,
>
> Tas.
>
>
> Sylvain wrote:
>
>> Hi again,
>
>> To be more precise, here's a java sample of what I want to do in eCore:
>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> }
>> }
>
>> // class Component, a Element
>> public class Component extends Element { }
>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component)
>> result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>
>> Sylvain
>
>
>> Sylvain a écrit :
>>> Hi All,
>>>
>>> I've to create a metamodel with eCore. eCore is fine for my needs,
>>> but now I get into trouble: I've a composition that is a subset of
>>> another (see attached file). I've seen that there is a annotation
>>> named 'subsets' in UML.ecore. I would like to take advantage of the
>>> GenModel that use it, but I don't know how to use it ? I create a
>>> genmodel from my ecore model but I don't see where to make reference
>>> to UML.GenModel.
>>>
>>> Thanks for your help !
>>> Sylvain
>>>
>>> ------------------------------------------------------------ ------------
>>>
>
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #583279 is a reply to message #470161] Thu, 08 February 2007 15:59 Go to previous message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi Kenn,

I will try this, in order to keep a full eCore model...

Sylvain

Kenn Hussey a écrit :
> Sylvain,
>
> Take a look at the implementation of PackageImpl#getNestedPackages() or
> PackageImpl#getOwnedTypes(). There you'll see how a
> DerivedSubsetEObjectEList can be used to implement a list that subsbets
> another list by restricting its type, much the same as you are looking to
> do. Currently, however, the UML2 code generator does not generate this code,
> so you'll have to add it by hand.
>
> Kenn
>
> "Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
> news:eqcs2e$t55$1@utils.eclipse.org...
>> Hi again,
>>
>> To be more precise, here's a java sample of what I want to do in eCore:
>>
>> // main class Element, root for the others
>> public abstract class Element
>> {
>> private List<Element> composites = new ArrayList<Element>();
>> public List<Element> getComposites() {
>> return composites;
>> }
>> public void setComposites(List<Element> composites) {
>> this.composites = composites;
>> } }
>>
>> // class Component, a Element
>> public class Component extends Element { }
>>
>> // class configuration containing Element that are only instanceof
>> Components
>> public class Configuration extends Element
>> {
>> public List<Component> getComponents() {
>> List<Component> result = new ArrayList<Component>();
>> for (Element composite : this.getComposites()) {
>> if (composite instanceof Component) result.add((Component)composite);
>> }
>> return result;
>> }
>> public void addComponent(Component c) {
>> this.getComposites().add(c);
>> }
>> }
>>
>> This way the component list is clearly a subset of composites...
>> Thanks for your help !
>>
>> Sylvain
>>
>>
>> Sylvain a écrit :
>>> Hi All,
>>>
>>> I've to create a metamodel with eCore. eCore is fine for my needs, but
>>> now I get into trouble: I've a composition that is a subset of another
>>> (see attached file). I've seen that there is a annotation named 'subsets'
>>> in UML.ecore. I would like to take advantage of the GenModel that use it,
>>> but I don't know how to use it ? I create a genmodel from my ecore model
>>> but I don't see where to make reference to UML.GenModel.
>>>
>>> Thanks for your help !
>>> Sylvain
>>>
>>> ------------------------------------------------------------ ------------
>>>
>
>
Re: Using UML2 GenModel with a simple eCore model to handle 'subsets' [message #586737 is a reply to message #470205] Fri, 09 February 2007 11:17 Go to previous message
Sylvain is currently offline SylvainFriend
Messages: 40
Registered: July 2009
Member
Hi Kenn,

Your solution works well, but everything gets harder when I had a
relation one-to-one between my component and my configuration that is
another subset of the main "composite" relation: this relation give a
class attribute after code generation, but in fact i wanted that this
attribute is the only elements in my "composite" collection.

I think I will find a workaround to this problem: my composite become a
"derived" relation and I will implements the "getComposites()" by hand.

Sylvain

Sylvain a écrit :
> Hi Kenn,
>
> I will try this, in order to keep a full eCore model...
>
> Sylvain
>
> Kenn Hussey a écrit :
>> Sylvain,
>>
>> Take a look at the implementation of PackageImpl#getNestedPackages()
>> or PackageImpl#getOwnedTypes(). There you'll see how a
>> DerivedSubsetEObjectEList can be used to implement a list that
>> subsbets another list by restricting its type, much the same as you
>> are looking to do. Currently, however, the UML2 code generator does
>> not generate this code, so you'll have to add it by hand.
>>
>> Kenn
>>
>> "Sylvain" <sylvain.maillard@univ-nantes.fr> wrote in message
>> news:eqcs2e$t55$1@utils.eclipse.org...
>>> Hi again,
>>>
>>> To be more precise, here's a java sample of what I want to do in eCore:
>>>
>>> // main class Element, root for the others
>>> public abstract class Element
>>> {
>>> private List<Element> composites = new ArrayList<Element>();
>>> public List<Element> getComposites() {
>>> return composites;
>>> }
>>> public void setComposites(List<Element> composites) {
>>> this.composites = composites;
>>> } }
>>>
>>> // class Component, a Element
>>> public class Component extends Element { }
>>>
>>> // class configuration containing Element that are only instanceof
>>> Components
>>> public class Configuration extends Element
>>> {
>>> public List<Component> getComponents() {
>>> List<Component> result = new ArrayList<Component>();
>>> for (Element composite : this.getComposites()) {
>>> if (composite instanceof Component) result.add((Component)composite);
>>> }
>>> return result;
>>> }
>>> public void addComponent(Component c) {
>>> this.getComposites().add(c);
>>> }
>>> }
>>>
>>> This way the component list is clearly a subset of composites...
>>> Thanks for your help !
>>>
>>> Sylvain
>>>
>>>
>>> Sylvain a écrit :
>>>> Hi All,
>>>>
>>>> I've to create a metamodel with eCore. eCore is fine for my needs,
>>>> but now I get into trouble: I've a composition that is a subset of
>>>> another (see attached file). I've seen that there is a annotation
>>>> named 'subsets' in UML.ecore. I would like to take advantage of the
>>>> GenModel that use it, but I don't know how to use it ? I create a
>>>> genmodel from my ecore model but I don't see where to make reference
>>>> to UML.GenModel.
>>>>
>>>> Thanks for your help !
>>>> Sylvain
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>>
>>
>>
Previous Topic:Replacing UML2::NamedElement::isDistinguishableFrom with new operation i a profile?
Next Topic:Profile with enumeration in same file as model -> ClassCastException
Goto Forum:
  


Current Time: Wed Apr 08 07:06:58 GMT 2020

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

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

Back to the top