Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Attribute Types
Attribute Types [message #628376] Tue, 20 April 2010 13:16 Go to next message
Kidlike  is currently offline Kidlike
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..
Re: Attribute Types [message #628379 is a reply to message #628376] Wed, 21 April 2010 11:35 Go to previous messageGo to next message
Kidlike  is currently offline Kidlike
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 #628412 is a reply to message #628379] Tue, 27 April 2010 09:51 Go to previous message
Timothy Marc is currently offline Timothy Marc
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"
Previous Topic:Ecore 2 Uml conversion question
Next Topic:Ecore 2 Uml conversion question
Goto Forum:
  


Current Time: Fri Oct 24 13:36:31 GMT 2014

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

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