XtremeBaumer
XtremeBaumer

Reputation: 6435

UML-how to make it the right model?

I need to make an UML-diagram, but I am not sure on how to realize 1 specific thing int it. Let's say I have a license as object, which can either be an terminal or an anywhere license. It has to be one of them and cannot be none of it. I thought to have the license object which is connected to anywhere license and terminal with the cardinalities 0..1 to both. Is this right? Should I have other cardinalities or a completely other structure?

Upvotes: 0

Views: 28

Answers (1)

Ister
Ister

Reputation: 6318

What you describe sounds more like a generalization, where license is an abstract class and terminal and anywhere license are its specializations.

However you might have wanted to just have in the license a location attribute with values terminal and anywhere license as possible values. Then create enumeration LocationEnum with available values terminal and anywhere license. Then add to `license' attribute:

location:LocationEnum

Then your location will have to have one of values available in LocationEnum.

Your question can also be understood in other ways but those are the most probable methods that will be a suitable solution. Which one to choose depends on more model details.

Upvotes: 1

Related Questions