Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Attribute Types
icon5.gif  Attribute Types [message #528420] Tue, 20 April 2010 13:16 Go to next message
Kidlike  is currently offline Kidlike Friend
Messages: 6
Registered: April 2010
Junior Member
Hi all,

I am quite new to UML modeling.

I want to set an attribute's type to Vector or Hashtable.
It seems that i can only use the uml's and ecore's primitive types, which are limited.

Any help is appreciated!

thanks in advance..
icon6.gif  Re: Attribute Types [message #528651 is a reply to message #528420] Wed, 21 April 2010 11:35 Go to previous messageGo to next message
Kidlike  is currently offline Kidlike Friend
Messages: 6
Registered: April 2010
Junior Member
In case anyone had the same problem I found the solution..


You have to create a new primitive type in the .umlclass

Then edit the .genmodel with "Generic EMF Form Editor" select your primitive type and change the field "instance Type Name" to the respective type you want. for example "java.util.Vector"
Re: Attribute Types [message #529802 is a reply to message #528651] Tue, 27 April 2010 09:51 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi Kidlike,

be careful with your solution. The question which currently appears is,
what you want to achieve in the end? Do you want to use UML for modeling
your system? Or do you want to use UML for modeling your DSL which will
be transformed to Ecore afterwards?

In the first case, technology-dependent constructs like Hashtable or
Vector are not predefined. There is a Java types library available in
Eclipse per default, but i've never used it. However, UML is
technology-independent a priori. If you want to use types like vector
(which is finally a list) you can model a property with a multiplicity > 1.

For example:
att:Integer [*] -> in Java comparable to new Vector<Integer>();

In combination with isUnique and isOrdered attributes, you're able to
define any list or set you want to.

1. att:Integer [*] unique, ordered -> in Java: implementation of
SortedSet interface
2. att:Integer [*] unique -> Set
3. att:Integer [*] non-unique, ordered -> List
4. att:Integer [*] non-unique -> Bag (Collection)

In context of code generation the information of a property might be
transformed in the appropriate java/c++/c# constructs, or whatever you want.

Cheers,
Timothy

Kidlike schrieb:
> In case anyone had the same problem I found the solution..
>
>
> You have to create a new primitive type in the .umlclass
>
> Then edit the .genmodel with "Generic EMF Form Editor" select your
> primitive type and change the field "instance Type Name" to the
> respective type you want. for example "java.util.Vector"
Re: Attribute Types [message #530253 is a reply to message #529802] Thu, 29 April 2010 06:44 Go to previous messageGo to next message
Kidlike  is currently offline Kidlike Friend
Messages: 6
Registered: April 2010
Junior Member
I see.. Thanks for your answer. It helped out a lot ! Smile
Re: Attribute Types [message #628416 is a reply to message #529802] Thu, 29 April 2010 06:44 Go to previous message
Kidlike  is currently offline Kidlike Friend
Messages: 6
Registered: April 2010
Junior Member
I see.. Thanks for your answer. It helped out a lot ! :)
Previous Topic:[Announce] Webinar: CDO Model Repository - Apr. 29
Next Topic:Stereoytpes are not applied after serialization!
Goto Forum:
  


Current Time: Thu Apr 25 08:03:17 GMT 2024

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

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

Back to the top