|Re: Attribute Types [message #529802 is a reply to message #528651]
||Tue, 27 April 2010 09:51
| Timothy Marc
Registered: July 2009
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.
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
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.
> 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"
Powered by FUDForum
. Page generated in 0.01839 seconds