Reputation: 11
I've taken the course Object Oriented System and Design at Stockholm University. I had to hand in an extra assignment where I had to create a UML Class Diagram reflecting a web site that sold cars (this is not a thread where I'm asking you to do my homework). This is what I handed in:
The teacher said that "this isn't how you use attributes" and seems reluctant to explaining what I should have done differently. It's all in Swedish but I think that the main points are clear regardless of language.
My question is: How should this have been modeled differently? I have aggregation for some objects, enums because the website had a limited amount of attributes for some classes.
Any help is greatly appreciated.
Kind regards,
Hugo
Upvotes: 1
Views: 5075
Reputation: 10540
It looks to me like you've got your Enumerations modeled as Classes. Even though visually an Enumeration looks like a Class with an <> stereotype, it's really a different thing altogether and it has EnumerationLiterals in the compartment when Attributes would be for a Class.
In ArgoUML you can create an Enumeration using the fourth button from the right on the toolbar. It's a dropdown menu which defaults to creating a new Datatype, but if you pull it down and select the green rectangle, it'll create an Enumeration. Create your Enumerations first and they'll be available for you to select as the type for your Attributes.
The final result should look like this:
Upvotes: 0
Reputation: 39708
I see some problems in your diagram:
Bil
has a aggregation relation to this SäkerhetsTilägg
, and additionally defines an attribute säkerhet
. You should either use a relation or an attribute, see here.Bil
can have any number of SäkerhetsTilägg
, while the attribute säkerhet
holds exactly one SäkerhetsTilägg
.+
, -
etc).Upvotes: 1