140 likes | 268 Views
UML: An Overview. A great resource for UML:. Learning UML 2.0 Russ Miles, Kim Hamilton 2006 O’Reilly Media Available in Safari. What is UML?. UML is notation. UML is not a technology . UML is not a method . UML is a set of notations used to express software design.
E N D
A great resource for UML: Learning UML 2.0 Russ Miles, Kim Hamilton 2006 O’Reilly Media Available in Safari
UML is notation. UML is not a technology. UML is not a method.
UML is a set of notations used to express software design. How do the entities interact with each other? What is the software supposed to do? How do the entities get organized into binaries? How do components interact? What entities are in the software (i.e., classes) and how do they relate to each other? • When the software executes, what processing nodes are involved? How do they interact?
We focus on a few diagrams that answer these questions. How do the entities interact with each other? What is the software supposed to do? How do the entities get organized into binaries? How do components interact? What entities are in the software (i.e., classes) and how do they relate to each other? • When the software executes, what processing nodes are involved? How do they interact?
Use Cases diagrams depict the relationship between actors and use cases and different use cases. Clock Set Alarm Time «include» What is the software supposed to do? Update Display «include» Set Day Time Clock User Activate Alarm «include» Deactivate Alarm Inform a Minute Has Passed Snooze Sixty Second Timer
Class Diagrams depict the static details of and relationships between classes in the system. TimeManager SixtySecondTimer + TimeManager() + setDisplay(newDisplay : Display) : void + setModeManager(newModeMgr : ModeManager) : void + setAlarm(newAlarm : Alarm) : void + SixtySecondTimer() + setTimeManager (newTimeMgr : TimeManager : void + start() : void -timer -timeMgr -display Clock ModeManager -modeMgr Display What entities are in the software (i.e., classes) and how do they relate to each other? How do they behave? +Clock() + start() : void + ModeManager() + Display() -buttonMgr ButtonManager Alarm -alarm + ButtonManager() + setModeManager(newModeMgr : ModeManager) : void + setTimeManager(newTimeMgr : TimeManager) : void + Alarm()
Sequence Diagrams depict the dynamic (run-time) interaction between objects. How do the entities interact with each other? :SixtySecondTimer timeMgr:TimeManager currentTime:Time display:Display modeMgr:ModeManager alarm:Alarm handleTimeout() incrementCurrentMinute() addOneMinute() hour:=getHour() Handles decision of what hour to digits to display minute := getMinute() showHour(hour) Handles decision of what hour to digits to display showMinute(minute) currentMode := getCurrentMode() opt [(currentMode == Mode.ALARM_ON) && ((currentTime.equals(alarmTime) || currentTime.equals(snoozeTime))] on()
UML use case diagrams, class diagrams, and sequence diagrams work together. Inform a Minute Has Passed SixtySecondTimer Alarm TimeManager ModeManager Time Display :SixtySecondTimer timeMgr:TimeManager currentTime:Time display:Display modeMgr:ModeManager alarm:Alarm handleTimeout() incrementCurrentMinute() addOneMinute() hour:=getHour() Handles decision of what hour to digits to display minute := getMinute() showHour(hour) Handles decision of what hour to digits to display showMinute(minute) currentMode := getCurrentMode() opt [(currentMode == Mode.ALARM_ON) && ((currentTime.equals(alarmTime) || currentTime.equals(snoozeTime))] on()
Component Diagrams capture the physical packaging of code (think “library” or “executable”). Timer How do the entities get organized into binaries? How do components interact? ClockBehavior Displau Alarm
Deployment Diagrams capture the relationship among the processing nodes of the system. Display CPU Primary CPU When the software executes, what processing nodes are involved? How do they interact?
UML notations enable traceability from requirements to deployment. Inform a Minute Has Passed Display TimeManager Time ModeManager Alarm SixtySecondTimer Timer ClockBehavior Displau Alarm Display CPU Primary CPU
So… • UML is a communication tool • UML has no inherent methodology • Capturing a design in UML requires many diagrams • Fundamental Point: • You are only guaranteed what you see.