Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » [newbie] Basic Types in UML
[newbie] Basic Types in UML [message #628435] Wed, 05 May 2010 13:39 Go to next message
orlin  is currently offline orlin Friend
Messages: 13
Registered: April 2010
Junior Member
How can I use basic types, such as Map, String, etc?

Can I represent generic types (Map <String, String>) in UML (or can I do so only in OCL)?
Re: [newbie] Basic Types in UML [message #628438 is a reply to message #628435] Fri, 07 May 2010 16:56 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi,

UML has a template construct call TemplateSignature that you can use to
define parameters for types. To see how it works, I suggest that you
look at the Ecore.UML model provided by the UML2 project, or convert any
Ecore model that defines generic types to UML.

As for OCL, it defines a few parameterized types in the standard
library, but provides no means to define new parameterized types of your
own nor even a syntax to for working with parameterized types in your
UML model. It's a pretty big hole in the language ...

HTH,

Christian


On 05/05/10 09:39 AM, orlin wrote:
> How can I use basic types, such as Map, String, etc?
>
> Can I represent generic types (Map <String, String>) in UML (or can I do
> so only in OCL)?
Re: [newbie] Basic Types in UML [message #628444 is a reply to message #628435] Tue, 11 May 2010 14:50 Go to previous messageGo to next message
Erhard Weinell is currently offline Erhard WeinellFriend
Messages: 39
Registered: January 2010
Location: Kassel, Germany
Member
Am 05.05.2010 15:39, schrieb orlin:
> How can I use basic types, such as Map, String, etc?
>
> Can I represent generic types (Map <String, String>) in UML (or can I do
> so only in OCL)?

Map is a platform library and as such very low level in terms of model
abstraction. Better use qualified associations!

Best,
Erhard

--
Meet us online!
w http://www.yatta.de
tw @YattaSolutions
fb http://www.facebook.com/pages/Yatta-Solutions-GmbH/933852562 69
Re: [newbie] Basic Types in UML [message #628445 is a reply to message #628435] Tue, 11 May 2010 16:54 Go to previous messageGo to next message
orlin  is currently offline orlin Friend
Messages: 13
Registered: April 2010
Junior Member
thanks for both answers.

@Christian, generics are a newer concept then OCL, so I was actually quite skeptical about it. And for OCL I did mean to specify in the pre condition, that key is of type X and value of type Y

@Erhard, can you give me an example of such a qualified association?
The reason why I am searching for something less generic and more java orientated is, in order to be able to automaticly generate the (java) structure from the uml specification. If I am to create my own maps, then probably the code generation will recreate them as well.

Orlin
Re: [newbie] Basic Types in UML [message #628447 is a reply to message #628435] Wed, 12 May 2010 14:32 Go to previous message
orlin  is currently offline orlin Friend
Messages: 13
Registered: April 2010
Junior Member
thanks, now I know what you mean.

The reason I want (need) to use java maps (and probably other java classes), is because I need to be able to use some frameworks, for example (apache) commons chain, where I need the execute(Map) method.

My current solution is to create another model, where I create as primitive type Map (in package java.util), when I think about it, it might be the only possible way...
Previous Topic:[newbie] Basic Types in UML
Next Topic:missing MARTE stereotypes with deserialized UML2 models
Goto Forum:
  


Current Time: Fri Mar 29 05:24:51 GMT 2024

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

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

Back to the top