Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Ecore Model 2 UML Model
Ecore Model 2 UML Model [message #475784] Fri, 07 September 2007 14:18 Go to next message
Eclipse UserFriend
Originally posted by: rmishra.tibco.com

Hi ,
I m trying to generate UML model out of EMF model using export model wizard
of UML2 plug-in but it seems the convention of composition relationship is
opposite of as it should be.

lets take an example --
there are 2 uml classes BookStore and BookType ,BookStore contains BookType,
the diagramatic representation should be something like this,

BookStore<----------------BookType

but the UML model generated by UML plug-in represents just opposite --

the uml file is something like this,

<uml:Model xmi:id="_bT4BMF1MEdydy4MnsAPyHQ" name="books">

<packagedElement xmi:type="uml:Class" xmi:id="_bT4BMV1MEdydy4MnsAPyHQ"
name="BookStore">

<ownedAttribute xmi:id="_bT4BMl1MEdydy4MnsAPyHQ" name="book"
type="_bT4BM11MEdydy4MnsAPyHQ" isOrdered="true" aggregation="composite"
association="_bT4BNV1MEdydy4MnsAPyHQ"/>

</packagedElement>

<packagedElement xmi:type="uml:Class" xmi:id="_bT4BM11MEdydy4MnsAPyHQ"
name="BookType">

<ownedAttribute xmi:id="_bT4BNF1MEdydy4MnsAPyHQ" name="publisher"
visibility="public" isOrdered="true" isUnique="false">

<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EStr ing"/>

</ownedAttribute>

</packagedElement>

<packagedElement xmi:type="uml:Association" xmi:id="_bT4BNV1MEdydy4MnsAPyHQ"
memberEnd="_bT4BMl1MEdydy4MnsAPyHQ _bT4BNl1MEdydy4MnsAPyHQ">

<ownedEnd xmi:id="_bT4BNl1MEdydy4MnsAPyHQ" type="_bT4BMV1MEdydy4MnsAPyHQ"
association="_bT4BNV1MEdydy4MnsAPyHQ"/>

</packagedElement>



</uml:Model>

</xmi:XMI>


if u see the line <packagedElement xmi:type="uml:Association"
xmi:id="_bT4BNV1MEdydy4MnsAPyHQ" memberEnd="_bT4BMl1MEdydy4MnsAPyHQ
_bT4BNl1MEdydy4MnsAPyHQ">
the memberEnd value is from BookType to BookStore but it's supposed to be
other way round----



i am not very sure if i m right so can any body help me out with this ---
Re: Ecore Model 2 UML Model [message #475847 is a reply to message #475784] Fri, 07 September 2007 17:37 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Raju,

Firstly, I think there might be something a bit wrong with your diagram.
If BookStore contains BookType then you would have somethign like

BookStore<>----->BookType
or
BookStore<>------BookType.

With a solid diamond on the BookStore end.

Secondly, just because one might naturally assume that the souce end of the
association is BookStore, it might not be. Imagine drawing a simple
bidirectional association between two classes ( in any particular order , no
composition). Now imagine wanting to make one end composite. You wouldn't
have to change the order of the ends as they appear in the memberEnd
collection to accomplish that.

Also, keep in mind that associations are n-ary, meaning that you can have
many different ends. Most tools don't allow this but the spec allows for
that. In such a case, you wouldn't think of one particular end as being
the source or target necessarily.

There is a convention in some diagramming tools that the member end in the
first position is the source but that is a tooling but that doesn't mean
that there is a mistake in the order of the ends semantically.

Refer to the superstructure spec, see figure 7.12 in the superstructure
spec. and the end of chapter 7 for details about associations.

I hope that helps.

- James.


"Raju Mishra" <rmishra@tibco.com> wrote in message
news:fbrmkk$lqa$1@build.eclipse.org...
> Hi ,
> I m trying to generate UML model out of EMF model using export model
wizard
> of UML2 plug-in but it seems the convention of composition relationship is
> opposite of as it should be.
>
> lets take an example --
> there are 2 uml classes BookStore and BookType ,BookStore contains
BookType,
> the diagramatic representation should be something like this,
>
> BookStore<----------------BookType
>
> but the UML model generated by UML plug-in represents just opposite --
>
> the uml file is something like this,
>
> <uml:Model xmi:id="_bT4BMF1MEdydy4MnsAPyHQ" name="books">
>
> <packagedElement xmi:type="uml:Class" xmi:id="_bT4BMV1MEdydy4MnsAPyHQ"
> name="BookStore">
>
> <ownedAttribute xmi:id="_bT4BMl1MEdydy4MnsAPyHQ" name="book"
> type="_bT4BM11MEdydy4MnsAPyHQ" isOrdered="true" aggregation="composite"
> association="_bT4BNV1MEdydy4MnsAPyHQ"/>
>
> </packagedElement>
>
> <packagedElement xmi:type="uml:Class" xmi:id="_bT4BM11MEdydy4MnsAPyHQ"
> name="BookType">
>
> <ownedAttribute xmi:id="_bT4BNF1MEdydy4MnsAPyHQ" name="publisher"
> visibility="public" isOrdered="true" isUnique="false">
>
> <type xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EStr ing"/>
>
> </ownedAttribute>
>
> </packagedElement>
>
> <packagedElement xmi:type="uml:Association"
xmi:id="_bT4BNV1MEdydy4MnsAPyHQ"
> memberEnd="_bT4BMl1MEdydy4MnsAPyHQ _bT4BNl1MEdydy4MnsAPyHQ">
>
> <ownedEnd xmi:id="_bT4BNl1MEdydy4MnsAPyHQ" type="_bT4BMV1MEdydy4MnsAPyHQ"
> association="_bT4BNV1MEdydy4MnsAPyHQ"/>
>
> </packagedElement>
>
>
>
> </uml:Model>
>
> </xmi:XMI>
>
>
> if u see the line <packagedElement xmi:type="uml:Association"
> xmi:id="_bT4BNV1MEdydy4MnsAPyHQ" memberEnd="_bT4BMl1MEdydy4MnsAPyHQ
> _bT4BNl1MEdydy4MnsAPyHQ">
> the memberEnd value is from BookType to BookStore but it's supposed to be
> other way round----
>
>
>
> i am not very sure if i m right so can any body help me out with this ---
>
>
Re: Ecore Model 2 UML Model [message #624738 is a reply to message #475784] Fri, 07 September 2007 17:37 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Raju,

Firstly, I think there might be something a bit wrong with your diagram.
If BookStore contains BookType then you would have somethign like

BookStore<>----->BookType
or
BookStore<>------BookType.

With a solid diamond on the BookStore end.

Secondly, just because one might naturally assume that the souce end of the
association is BookStore, it might not be. Imagine drawing a simple
bidirectional association between two classes ( in any particular order , no
composition). Now imagine wanting to make one end composite. You wouldn't
have to change the order of the ends as they appear in the memberEnd
collection to accomplish that.

Also, keep in mind that associations are n-ary, meaning that you can have
many different ends. Most tools don't allow this but the spec allows for
that. In such a case, you wouldn't think of one particular end as being
the source or target necessarily.

There is a convention in some diagramming tools that the member end in the
first position is the source but that is a tooling but that doesn't mean
that there is a mistake in the order of the ends semantically.

Refer to the superstructure spec, see figure 7.12 in the superstructure
spec. and the end of chapter 7 for details about associations.

I hope that helps.

- James.


"Raju Mishra" <rmishra@tibco.com> wrote in message
news:fbrmkk$lqa$1@build.eclipse.org...
> Hi ,
> I m trying to generate UML model out of EMF model using export model
wizard
> of UML2 plug-in but it seems the convention of composition relationship is
> opposite of as it should be.
>
> lets take an example --
> there are 2 uml classes BookStore and BookType ,BookStore contains
BookType,
> the diagramatic representation should be something like this,
>
> BookStore<----------------BookType
>
> but the UML model generated by UML plug-in represents just opposite --
>
> the uml file is something like this,
>
> <uml:Model xmi:id="_bT4BMF1MEdydy4MnsAPyHQ" name="books">
>
> <packagedElement xmi:type="uml:Class" xmi:id="_bT4BMV1MEdydy4MnsAPyHQ"
> name="BookStore">
>
> <ownedAttribute xmi:id="_bT4BMl1MEdydy4MnsAPyHQ" name="book"
> type="_bT4BM11MEdydy4MnsAPyHQ" isOrdered="true" aggregation="composite"
> association="_bT4BNV1MEdydy4MnsAPyHQ"/>
>
> </packagedElement>
>
> <packagedElement xmi:type="uml:Class" xmi:id="_bT4BM11MEdydy4MnsAPyHQ"
> name="BookType">
>
> <ownedAttribute xmi:id="_bT4BNF1MEdydy4MnsAPyHQ" name="publisher"
> visibility="public" isOrdered="true" isUnique="false">
>
> <type xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EStr ing"/>
>
> </ownedAttribute>
>
> </packagedElement>
>
> <packagedElement xmi:type="uml:Association"
xmi:id="_bT4BNV1MEdydy4MnsAPyHQ"
> memberEnd="_bT4BMl1MEdydy4MnsAPyHQ _bT4BNl1MEdydy4MnsAPyHQ">
>
> <ownedEnd xmi:id="_bT4BNl1MEdydy4MnsAPyHQ" type="_bT4BMV1MEdydy4MnsAPyHQ"
> association="_bT4BNV1MEdydy4MnsAPyHQ"/>
>
> </packagedElement>
>
>
>
> </uml:Model>
>
> </xmi:XMI>
>
>
> if u see the line <packagedElement xmi:type="uml:Association"
> xmi:id="_bT4BNV1MEdydy4MnsAPyHQ" memberEnd="_bT4BMl1MEdydy4MnsAPyHQ
> _bT4BNl1MEdydy4MnsAPyHQ">
> the memberEnd value is from BookType to BookStore but it's supposed to be
> other way round----
>
>
>
> i am not very sure if i m right so can any body help me out with this ---
>
>
Previous Topic:XMI serialization of UML2 model
Next Topic:XMI serialization of UML2 model
Goto Forum:
  


Current Time: Tue Apr 16 19:39:45 GMT 2024

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

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

Back to the top