Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Trying to define attribute in class in diagram of type "Set<ComponentType>"
Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #501797] Thu, 03 December 2009 20:03 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 800
Registered: July 2009
Senior Member
I have a simple class diagram, with classes "Catalog" and "Category". I'll be adding many more classes, but these are the first two. There is a property of "Catalog" called "rootCategories", which should be a "Set<Category>". It's easy enough to define an association from Catalog to Category and label it on the source end with "rootCategories", but I'd like to define a "rootCategories" attribute of "Catalog" of type "Set<Category>".

I've created the two class icons, along with the association, but I don't understand the steps required to get that attribute created with that type.
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #501913 is a reply to message #501797] Fri, 04 December 2009 12:49 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
It is not an easy question because when you create an attribute in the model this is not detected as an association till you don't also create an association between both classifiers. This is a two steps creation and not just the attribute creation.

If you use Java then I agree that if you create an attribute having set<category> then you will have an association between both classifiers. Don't forget that this association is detected and coming from the java tool using JDK and not from the UML model itself. It means that this information is detected from the java code then copied in the model in which both attribute and association will be create at the same time.

[Updated on: Fri, 04 December 2009 12:52]

Report message to a moderator

Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #501931 is a reply to message #501797] Fri, 04 December 2009 14:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
David,

Your question appears to be about Java generics but that isn't directly
supported by UML itself. I suppose something equivalent is a
multi-valued property that's unordered and unique, but even this, if
mapped to Ecore and then to Java will result in EList<Category> not
Set<Category>...


David M. Karr wrote:
> I have a simple class diagram, with classes "Catalog" and "Category".
> I'll be adding many more classes, but these are the first two. There
> is a property of "Catalog" called "rootCategories", which should be a
> "Set<Category>". It's easy enough to define an association from
> Catalog to Category and label it on the source end with
> "rootCategories", but I'd like to define a "rootCategories" attribute
> of "Catalog" of type "Set<Category>".
>
> I've created the two class icons, along with the association, but I
> don't understand the steps required to get that attribute created with
> that type.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #501945 is a reply to message #501931] Fri, 04 December 2009 14:58 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 800
Registered: July 2009
Senior Member
Just show me the best reasonable compromise, in order to show in the UML diagram that it represents a Set of a particular component type. If you can't show the component type, I can live with that. If you can't use the word "Set", I can live with that. What's the best I can get, and how do I do it? There are some steps in defining UML in this plugin that are not obvious.
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #501968 is a reply to message #501945] Fri, 04 December 2009 15:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
David,

I believe in UML terminology it's just a many-valued (unbounded
multiplicity) property and that the fact it's a set, collection, or list
is implicit in things like the property being unordered and unique.
Unfortunately I know nothing about how to use the UML graphical editor
to achieve your, so I'm not sure what steps you need to take. Maybe
someone else will help with the specifics of your question.


David M. Karr wrote:
> Just show me the best reasonable compromise, in order to show in the
> UML diagram that it represents a Set of a particular component type.
> If you can't show the component type, I can live with that. If you
> can't use the word "Set", I can live with that. What's the best I can
> get, and how do I do it? There are some steps in defining UML in this
> plugin that are not obvious.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #502018 is a reply to message #501968] Fri, 04 December 2009 19:25 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Ed,

Comment below:

Quote:
Unfortunately I know nothing about how to use the UML graphical editor to achieve your, so I'm not sure what steps you need to take. Maybe someone else will help with the specifics of your question.


Do we really need such an answer ? you undermine any shred of credibility you might still have left on UML modeling.

PS: Please don't say I copied your previous reply, I know and this intentional Smile

[Updated on: Fri, 04 December 2009 19:27]

Report message to a moderator

Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #502021 is a reply to message #502018] Fri, 04 December 2009 19:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Vlad,

I make no claims to be a credible UML expert let alone an expert in the
tools. I simply help as best I can when no one else steps in to do better.

Of course you copied my previous reply. It's a bit juvenile, but that
seems to keep you entertained.


Vlad Varnica wrote:
> Ed answer below:
>
> Quote:
>> Unfortunately I know nothing about how to use the UML graphical
>> editor to achieve your, so I'm not sure what steps you need to take.
>> Maybe someone else will help with the specifics of your question.
>
>
> Do we really need such an answer ? you undermine any shred of
> credibility you might still have left on UML modeling.
>
> PS: Please don't say I copied your previous reply, I know and this
> intentional :)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #625327 is a reply to message #501931] Fri, 04 December 2009 14:58 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 800
Registered: July 2009
Senior Member
Just show me the best reasonable compromise, in order to show in the UML diagram that it represents a Set of a particular component type. If you can't show the component type, I can live with that. If you can't use the word "Set", I can live with that. What's the best I can get, and how do I do it? There are some steps in defining UML in this plugin that are not obvious.
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #625328 is a reply to message #625327] Fri, 04 December 2009 15:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
David,

I believe in UML terminology it's just a many-valued (unbounded
multiplicity) property and that the fact it's a set, collection, or list
is implicit in things like the property being unordered and unique.
Unfortunately I know nothing about how to use the UML graphical editor
to achieve your, so I'm not sure what steps you need to take. Maybe
someone else will help with the specifics of your question.


David M. Karr wrote:
> Just show me the best reasonable compromise, in order to show in the
> UML diagram that it represents a Set of a particular component type.
> If you can't show the component type, I can live with that. If you
> can't use the word "Set", I can live with that. What's the best I can
> get, and how do I do it? There are some steps in defining UML in this
> plugin that are not obvious.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #625380 is a reply to message #501968] Fri, 04 December 2009 19:25 Go to previous message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Ed answer below:

Quote:
> Unfortunately I know nothing about how to use the UML graphical editor to achieve your, so I'm not sure what steps you need to take. Maybe someone else will help with the specifics of your question.


Do we really need such an answer ? you undermine any shred of credibility you might still have left on UML modeling.

PS: Please don't say I copied your previous reply, I know and this intentional :)
Re: Trying to define attribute in class in diagram of type "Set<ComponentType>" [message #625381 is a reply to message #625380] Fri, 04 December 2009 19:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Vlad,

I make no claims to be a credible UML expert let alone an expert in the
tools. I simply help as best I can when no one else steps in to do better.

Of course you copied my previous reply. It's a bit juvenile, but that
seems to keep you entertained.


Vlad Varnica wrote:
> Ed answer below:
>
> Quote:
>> Unfortunately I know nothing about how to use the UML graphical
>> editor to achieve your, so I'm not sure what steps you need to take.
>> Maybe someone else will help with the specifics of your question.
>
>
> Do we really need such an answer ? you undermine any shred of
> credibility you might still have left on UML modeling.
>
> PS: Please don't say I copied your previous reply, I know and this
> intentional :)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Where are the UML2 Tools sample projects?
Next Topic:Display UML 2 class diagram
Goto Forum:
  


Current Time: Thu Mar 28 20:48:34 GMT 2024

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

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

Back to the top