Presentation Transcript
MORE UML DIAGRAM TYPES: MORE UML DIAGRAM TYPES We have seen a number of UML diagram types while studying our example.
These slides show examples of a number of diagrams types not seen in our previous slides.
Again, for full notation and syntax, refer to http://www.uml.org
Object diagram: : Garage Object diagram car2 is an instance of class Truck This is really like a class diagram, but has objects instead of classes.
Constraints: Constraints
Collaboration Diagram: car: Sedan garage: Garage : GarageControl 1: returnCar 1.2: store(car) 1.1: return() GUI Collaboration Diagram Shows the calls between classes, but not their order (which is shown in sequence diagrams).
State Diagram: State Diagram A state diagram represents how objects (instances of a class) react to external events (message).
Typically used to specify the behaviour of so-called active objects.
Is composed of states (combination of attribute values at some point of time) and transitions between them.
May include an initial state and a final state.
State Diagram: Available InService Booked InUse return/
Stop counting time book take/
Start counting time service exit/ ready State Diagram Initial state
Activity diagram: Activity diagram An activity diagram represents how an activity is performed
Formally, this is a special case of a state diagram
Typically a higher-level activity with several actors.
The diagram can be partitioned into columns, which show the actors
Activity Diagram: Query Book Make a bill Pay Prepare car Register rental Client Official Take car :Bill
[open] :Bill
[paid] Activity Diagram Fork threads Join threads Initial state Final state
Packages: Objects Support Object Garage Sedan Storage registrationNo service(int km)
return() ObjectManagement use * returnObject(Object,Storage)
bookObject(Object) takeObject(Object) return()
book()
take() Controller 1 1 1 Packages
Packages in closed form: Packages in closed form