classumlclass-diagramtool-umlerd

UML Class Diagram - User and User Type


This is about User and User Type relationship.

I have two classes User and UserType User has UserID, UserName, UserTypeID UserType as : TypeID, TypeName

One user can have only one User Type (TypeID1/TypeID2/TypeID3)

What could be UML class diagram notation to represent this? is it association or composition or aggregation?

This diagram has Car and car type as Association http://www.jetbrains.com/idea/features/screenshots/80/uml2.png

This diagram has plugin and plugin type as composition http://indico-software.org/raw-attachment/wiki/Dev/Technical/PluginSystem/Plugin%20System%20class%20diagram.png


Solution

  • Something like this?
    enter image description here

    or like this
    enter image description here

    it dependents buddy, the first solution is useful when the user type does some functionality itself, in other word its a class(member), while the second solution is just useful when there is some constant about user types.