Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

if condition in uml class diagram?

if "attribute" is true do this "operation" else do nothing.

How do i show this in uml class diagram.

Thank you, kim

like image 468
kim Avatar asked Dec 22 '22 04:12

kim


2 Answers

You don't. Class diagrams does not show behavior, but only structure. To show behavior you can use sequence diagrams, and a condition in sequence diagram is shown be be a rectangle which in its top corner you write the condition and inside it you describe the operation that occurs if condition is true. You can read here for more information: http://en.wikipedia.org/wiki/Sequence_diagram

like image 93
duduamar Avatar answered Dec 24 '22 16:12

duduamar


It seems that this user would like to add business rules with condition in the class diagram. this option is not graphically possible with UML but could be added manually in the metamodel.

It is better to use the sequence diagram and frames. I found an example alt text

like image 22
UML GURU Avatar answered Dec 24 '22 16:12

UML GURU