Hello I have a few questions about UML class diagrams any help will be appreciated
1) How do you show pointers in attributes?
2) Whats multiplicity?
3) What direction should the composition arrows be?
4) How do you put enums?
Hello I have a few questions about UML class diagrams any help will be appreciated
1) How do you show pointers in attributes?
2) Whats multiplicity?
3) What direction should the composition arrows be?
4) How do you put enums?
According to the current UML standard 2.4.1 and the next one 2.5 (it differs almost only in more simple documentation):
Before other things you should understand
Yes, it is not easy, sorry. But it is MUCH easier, that the text of the "easier" 2.5 UML standard. Easy explanation is a false one, using it you'll quickly run into problems in any real task.
Composition and about it.
composition
, shared
and even none
, all three are aggregations. Somebody mixes parent and child terms. Simple old Enums are easy - there is a sort of class block for them, @MagicMan put it correctly. But they are obsolete already. And if you use more elaborated Java's Enumeration type (surely, other languages have it too), and you set different fields or functions for different items, you have to use class blocks for them, only you'll have to create your own stereotype (if your tool hasn't one already) and set the appropriate class block to it.
Edit:
So, simple pointer is arrow with dot. But if there exists another, back navigation, there will be NO arrows at all, and only dot(s).
In C++ instance A can have the B instance not by pointer, but directly. There is NO special UML sign for it, it should be shown in the same way as normal, pointer attribute.
1) Common way is like this for a one way association(pointer): ---->
, but apparently the correct way is to add a dot at the end to indicate the referenced side: ---->*
2) Multiplicty is the range it can run represented like this (0..1)
, ie a pointer can be null so that zero specifies it could have 0 to 1 target objects
3) Composition arrows belong on the containing object's side: Container<>-----Child
4) I've seen them represented like this:
_______________________
| <<enumeration>> |
| Colors |
|_____________________|
| Red |
| Green |
| Blue |
| ... |
|_____________________|
A good UML cheat-sheet: Link