Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Add an association into a package
Add an association into a package [message #472491] Thu, 05 April 2007 14:41 Go to next message
Eclipse UserFriend
Originally posted by: guillaume.clement.gmail.com

Hi,

I'm able to buil associations and their properties (linked to classes).

But I'm still looking for the way to add an association to a package.

I looked into the UML2 tutorial but I don't find it.

Best regards.

Guillaume
Re: Add an association into a package [message #472495 is a reply to message #472491] Thu, 05 April 2007 15:37 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Guillaume,

Which tutorial are you referring to? This is covered in the "Getting Started
with UML2" article available on the documenation page...

Kenn

"Guillaume Clement" <guillaume.clement@gmail.com> wrote in message
news:5c13b8998fd9b836c9501263190b808c$1@www.eclipse.org...
> Hi,
>
> I'm able to buil associations and their properties (linked to classes).
>
> But I'm still looking for the way to add an association to a package.
>
> I looked into the UML2 tutorial but I don't find it.
>
> Best regards.
>
> Guillaume
>
>
>
Re: Add an association into a package [message #472501 is a reply to message #472495] Tue, 10 April 2007 08:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: guillaume.clement.gmail.com

Yes I'm regarding the "Getting Started
with UML2".

Thx
Re: Add an association into a package [message #472502 is a reply to message #472501] Tue, 10 April 2007 08:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: guillaume.clement.gmail.com

Here is the code I use to create association and properties.
I just want to associate 2 classes.


Association association = UMLFactory.eINSTANCE.createAssociation();

Class class1 = UMLFactory.eINSTANCE.createClass();
class1.setName("Classe1");

Class class2 = UMLFactory.eINSTANCE.createClass();
class2.setName("Classe1");

Property porp1 = association.createNavigableOwnedEnd("test", class1);

Property porp2 = association.createNavigableOwnedEnd("test2", class2);

But I'm not able (don't know how to do that ;-( ) to add this builded
association into my package.
Re: Add an association into a package [message #472504 is a reply to message #472502] Tue, 10 April 2007 13:47 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Guillaume,

The getting started article...
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Getti ng_Started_with_UML2/article.html

explains this in the section: "Creating Associations"

It does something like the following:

Association association = type1.createAssociation(end1IsNavigable,
end1Aggregation, end1Name, end1LowerBound,
end1UpperBound, type2, end2IsNavigable, end2Aggregation,
end2Name, end2LowerBound, end2UpperBound);
Look at: TypeImpl.java at createAssociation() to see the details of how
the association is set up. Also, have a look at TypeOperations.java for
more gory details. Don't call the TypeOperations directly since these are
internal API, just have a look at how the associations are created. You can
either make the same calls or use the convenience API's to create your
association in one step.

Regards,

- James.



"Guillaume Clement" <guillaume.clement@gmail.com> wrote in message
news:47dce21f7272073433a48af8c702a049$1@www.eclipse.org...
> Here is the code I use to create association and properties.
> I just want to associate 2 classes.
>
>
> Association association = UMLFactory.eINSTANCE.createAssociation();
>
> Class class1 = UMLFactory.eINSTANCE.createClass();
> class1.setName("Classe1");
>
> Class class2 = UMLFactory.eINSTANCE.createClass();
> class2.setName("Classe1");
>
> Property porp1 = association.createNavigableOwnedEnd("test", class1);
>
> Property porp2 = association.createNavigableOwnedEnd("test2", class2);
>
> But I'm not able (don't know how to do that ;-( ) to add this builded
> association into my package.
>
Re: Add an association into a package [message #605444 is a reply to message #472491] Thu, 05 April 2007 15:37 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Guillaume,

Which tutorial are you referring to? This is covered in the "Getting Started
with UML2" article available on the documenation page...

Kenn

"Guillaume Clement" <guillaume.clement@gmail.com> wrote in message
news:5c13b8998fd9b836c9501263190b808c$1@www.eclipse.org...
> Hi,
>
> I'm able to buil associations and their properties (linked to classes).
>
> But I'm still looking for the way to add an association to a package.
>
> I looked into the UML2 tutorial but I don't find it.
>
> Best regards.
>
> Guillaume
>
>
>
Re: Add an association into a package [message #607429 is a reply to message #472495] Tue, 10 April 2007 08:14 Go to previous message
Eclipse UserFriend
Originally posted by: guillaume.clement.gmail.com

Yes I'm regarding the "Getting Started
with UML2".

Thx
Re: Add an association into a package [message #607430 is a reply to message #472501] Tue, 10 April 2007 08:23 Go to previous message
Eclipse UserFriend
Originally posted by: guillaume.clement.gmail.com

Here is the code I use to create association and properties.
I just want to associate 2 classes.


Association association = UMLFactory.eINSTANCE.createAssociation();

Class class1 = UMLFactory.eINSTANCE.createClass();
class1.setName("Classe1");

Class class2 = UMLFactory.eINSTANCE.createClass();
class2.setName("Classe1");

Property porp1 = association.createNavigableOwnedEnd("test", class1);

Property porp2 = association.createNavigableOwnedEnd("test2", class2);

But I'm not able (don't know how to do that ;-( ) to add this builded
association into my package.
Re: Add an association into a package [message #607434 is a reply to message #472502] Tue, 10 April 2007 13:47 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Guillaume,

The getting started article...
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Getti ng_Started_with_UML2/article.html

explains this in the section: "Creating Associations"

It does something like the following:

Association association = type1.createAssociation(end1IsNavigable,
end1Aggregation, end1Name, end1LowerBound,
end1UpperBound, type2, end2IsNavigable, end2Aggregation,
end2Name, end2LowerBound, end2UpperBound);
Look at: TypeImpl.java at createAssociation() to see the details of how
the association is set up. Also, have a look at TypeOperations.java for
more gory details. Don't call the TypeOperations directly since these are
internal API, just have a look at how the associations are created. You can
either make the same calls or use the convenience API's to create your
association in one step.

Regards,

- James.



"Guillaume Clement" <guillaume.clement@gmail.com> wrote in message
news:47dce21f7272073433a48af8c702a049$1@www.eclipse.org...
> Here is the code I use to create association and properties.
> I just want to associate 2 classes.
>
>
> Association association = UMLFactory.eINSTANCE.createAssociation();
>
> Class class1 = UMLFactory.eINSTANCE.createClass();
> class1.setName("Classe1");
>
> Class class2 = UMLFactory.eINSTANCE.createClass();
> class2.setName("Classe1");
>
> Property porp1 = association.createNavigableOwnedEnd("test", class1);
>
> Property porp2 = association.createNavigableOwnedEnd("test2", class2);
>
> But I'm not able (don't know how to do that ;-( ) to add this builded
> association into my package.
>
Previous Topic:UML(2) constraints
Next Topic:metamodel modifications
Goto Forum:
  


Current Time: Sat Apr 20 00:23:29 GMT 2024

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

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

Back to the top