Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home »  » UML2 » Profiles eCore <-> UML
Profiles eCore <-> UML [message #476016] Thu, 20 September 2007 15:02 Go to next message
Stefan Kuhn is currently offline Stefan KuhnFriend
Messages: 355
Registered: July 2009
Senior Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi, I was wondering how profiles defined in UML and eCore are connected
or differ from each other.

I noticed 2 major differences when definining a profile:

the profile in UML imports UML.metamodel.uml.
the profile in eCore imports UML.ecore
what are the differences between both metamodels?

Why is an association class needed in the profile definition? When I
compare both serialization:
UML:
<packagedElement xmi:type="uml:Stereotype" xmi:id="(...)**2"
name="Element">
<ownedAttribute xmi:id="(...)**3" name="base_Class"
visibility="private" association="(...)**1">
<type xmi:type="uml:Class"
href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
</ownedAttribute>
</packagedElement>

And the association class:

<packagedElement xmi:type="uml:Extension" xmi:id="(...)**1" name=""
memberEnd="(...)**4 (...)**3">
<ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="(...)**4"
name="extension_" visibility="private" type="(...)**2"
aggregation="composite" association="(...)**1">
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="(...)"
name="" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="(...)" name=""/>
</ownedEnd>
</packagedElement>


Ecore seems much more readable, and I don't see a benefit of the UML
definition since there's no lose of information in eCore:
<eClassifiers xsi:type="ecore:EClass" name="Element">
<eStructuralFeatures xsi:type="ecore:EReference" name="base_Class"
ordered="false"
lowerBound="1" eType="ecore:EClass
platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Clas s "/>
</eClassifiers>


thanks
- -stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8otuIYVWjMSpDwwRAmFIAKD1V6SkblABNo2wgabUl65w68JOrQCf djah
A+I6rFVCzIYZ3BC2CqudXj4=
=Ol5Q
-----END PGP SIGNATURE-----
Re: Profiles eCore <-> UML [message #476021 is a reply to message #476016] Fri, 21 September 2007 18:45 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Some comments below...

"SKuhn" <kuhn@oio.de> wrote in message
news:fcu22g$kvo$1@build.eclipse.org...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi, I was wondering how profiles defined in UML and eCore are connected
> or differ from each other.

Profile's defined using UML use metatypes from the UML metamodel. When
you "define" your profile, you create an ecore representation. In general,
UML is more expressive than Ecore however, the kind of information that
should be added to the UML representation in your profile should be fairly
simple and therefore the Ecore represnentation should roughly map 1-1 to the
Ecore representation.

>
> I noticed 2 major differences when definining a profile:
>
> the profile in UML imports UML.metamodel.uml.
> the profile in eCore imports UML.ecore
> what are the differences between both metamodels?

UML.ecore is the ecore representation of the merged UML metamodel. The api
is ultimately controlled by this .ecore representation but a mapping is made
from the .uml version of the metamodel to the ecore version first.


>
> Why is an association class needed in the profile definition? When I
> compare both serialization:
> UML:
> <packagedElement xmi:type="uml:Stereotype" xmi:id="(...)**2"
> name="Element">
> <ownedAttribute xmi:id="(...)**3" name="base_Class"
> visibility="private" association="(...)**1">
> <type xmi:type="uml:Class"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
> </ownedAttribute>
> </packagedElement>
>
> And the association class:
>
> <packagedElement xmi:type="uml:Extension" xmi:id="(...)**1" name=""
> memberEnd="(...)**4 (...)**3">
> <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="(...)**4"
> name="extension_" visibility="private" type="(...)**2"
> aggregation="composite" association="(...)**1">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="(...)"
> name="" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger" xmi:id="(...)" name=""/>
> </ownedEnd>
> </packagedElement>
>

I'm not sure what you mean by "association class" are you referring to the
extension? It is a way of indicating the metatype being extended.


>
> Ecore seems much more readable, and I don't see a benefit of the UML
> definition since there's no lose of information in eCore:
> <eClassifiers xsi:type="ecore:EClass" name="Element">
> <eStructuralFeatures xsi:type="ecore:EReference" name="base_Class"
> ordered="false"
> lowerBound="1" eType="ecore:EClass
> platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Clas s "/>
> </eClassifiers>
>
>

Ecore is definitely more readable but it represents a subset of what UML can
represent. It basically focuses on the "class" part of UML, ie.
representing classes, properties etc. Ecore does not deal with
statemachines, activities, interactions etc.


> thanks
> - -stefan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFG8otuIYVWjMSpDwwRAmFIAKD1V6SkblABNo2wgabUl65w68JOrQCf djah
> A+I6rFVCzIYZ3BC2CqudXj4=
> =Ol5Q
> -----END PGP SIGNATURE-----
Re: Profiles eCore <-> UML [message #624932 is a reply to message #476016] Fri, 21 September 2007 18:45 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Some comments below...

"SKuhn" <kuhn@oio.de> wrote in message
news:fcu22g$kvo$1@build.eclipse.org...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi, I was wondering how profiles defined in UML and eCore are connected
> or differ from each other.

Profile's defined using UML use metatypes from the UML metamodel. When
you "define" your profile, you create an ecore representation. In general,
UML is more expressive than Ecore however, the kind of information that
should be added to the UML representation in your profile should be fairly
simple and therefore the Ecore represnentation should roughly map 1-1 to the
Ecore representation.

>
> I noticed 2 major differences when definining a profile:
>
> the profile in UML imports UML.metamodel.uml.
> the profile in eCore imports UML.ecore
> what are the differences between both metamodels?

UML.ecore is the ecore representation of the merged UML metamodel. The api
is ultimately controlled by this .ecore representation but a mapping is made
from the .uml version of the metamodel to the ecore version first.


>
> Why is an association class needed in the profile definition? When I
> compare both serialization:
> UML:
> <packagedElement xmi:type="uml:Stereotype" xmi:id="(...)**2"
> name="Element">
> <ownedAttribute xmi:id="(...)**3" name="base_Class"
> visibility="private" association="(...)**1">
> <type xmi:type="uml:Class"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
> </ownedAttribute>
> </packagedElement>
>
> And the association class:
>
> <packagedElement xmi:type="uml:Extension" xmi:id="(...)**1" name=""
> memberEnd="(...)**4 (...)**3">
> <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="(...)**4"
> name="extension_" visibility="private" type="(...)**2"
> aggregation="composite" association="(...)**1">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="(...)"
> name="" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger" xmi:id="(...)" name=""/>
> </ownedEnd>
> </packagedElement>
>

I'm not sure what you mean by "association class" are you referring to the
extension? It is a way of indicating the metatype being extended.


>
> Ecore seems much more readable, and I don't see a benefit of the UML
> definition since there's no lose of information in eCore:
> <eClassifiers xsi:type="ecore:EClass" name="Element">
> <eStructuralFeatures xsi:type="ecore:EReference" name="base_Class"
> ordered="false"
> lowerBound="1" eType="ecore:EClass
> platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Clas s "/>
> </eClassifiers>
>
>

Ecore is definitely more readable but it represents a subset of what UML can
represent. It basically focuses on the "class" part of UML, ie.
representing classes, properties etc. Ecore does not deal with
statemachines, activities, interactions etc.


> thanks
> - -stefan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFG8otuIYVWjMSpDwwRAmFIAKD1V6SkblABNo2wgabUl65w68JOrQCf djah
> A+I6rFVCzIYZ3BC2CqudXj4=
> =Ol5Q
> -----END PGP SIGNATURE-----
Previous Topic:[Announce] MDT UML2 2.2.0 I200709211011 is available
Next Topic:packagedElement opposite?
Goto Forum:
  


Current Time: Sun Dec 17 00:33:11 GMT 2017

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

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