Download presentation
Presentation is loading. Please wait.
1
Using UML, Patterns, and Java Object-Oriented Software Engineering Art for Chapter 2, Modeling with UML
2
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 WatchUserWatchRepairPerson ReadTime SetTime ChangeBattery SimpleWatch Figure 2-1, A UML use case diagram describing the functionality of a simple watch.
3
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 Figure 2-2, A UML class diagram describing the elements of a simple watch. 1 2 1 1 1 1 1 2 SimpleWatch DisplayBatteryTimePushButton
4
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 Figure 2-3, A UML sequence diagram for the SimpleWatch. :SimpleWatch:Time:Display pressButton1() blinkHours() blinkMinutes() pressButton2() incrementMinutes() refresh() pressButtons1And2() commitNewTime() stopBlinking() pressButton1() :WatchUser
5
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 button1&2Pressed button1Pressed button2Pressed button1Pressed button1&2Pressed Increment Minutes Increment Hours Blink Hours Blink Seconds Blink Minutes Increment Seconds Stop Blinking Figure 2-4, A UML statechart diagram for SetTime use case of the SimpleWatch.
6
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Open Incident Allocate Resources Coordinate Resources Document Incident Archive Incident Figure 2-5, An example of a UML activity diagram.
7
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7 Airplane All blueprints Scale model Electrical Fuel Flight simulator Figure 2-6, A Model is an abstraction describing a subset of a System. A View depicts selected aspects of a Model. Views and Models of a single System may overlap each other.
8
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8 BookChapter N composed-of Booch BookChapter composed-of UML 1* Figure 2-7, Example of describing a model with two different notations.
9
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9 Watch time date CalculatorWatch SetDate(d) EnterCalcMode() InputNumber(n) calculatorState Figure 2-8, A UML class diagram depicting two classes: Watch and CalculatorWatch. CalculatorWatch is a refinement of Watch, providing calculator functionality normally not found in normal Watches.
10
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10 OrganicCompound Benzene Figure 2-9, An example of abstract class.
11
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11 Watch CalculatorWatch simpleWatch1291:Watch calculatorWatch1515 :CalculatorWatch «instanceOf» Figure 2-10, A UML class diagram depicting instances of two classes.
12
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12 pressButton2() getTime() getTimeDelta() :WatchUser GMTTime :SimpleWatch:TimeZone:Time Figure 2-11, Examples of message sends.
13
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13 Application DomainSolution Domain Application Domain ModelSystem Model Aircraft TrafficController FlightPlan Airport MapDisplay FlightPlanDatabase SummaryDisplay TrafficControl Figure 2-12, The application domain model represents entities of the environment which are relevant to an air traffic control system (e.g., aircraft, traffic controllers).
14
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14 Report Emergency FieldOfficerDispatcher OpenIncident AllocateResources FRIEND Figure 2-13, An example of a UML use case diagram: Incident initiation in an accident management system.
15
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15 OpenIncident AllocateResources HelpDispatcher «include» Figure 2-16, An example of an «include» relationship.
16
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16 Figure 2-18, An example of an «extend» relationship. OpenIncident AllocateResources ConnectionDown «extend»
17
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17 Authenticate WithPassword WithCard Figure 2-20, An example of a generalization relationship.
18
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18 EmergencyReport Incident FieldOfficer name:String badgeNumber:Integer Dispatcher name:String badgeNumber:Integer author incidentsGenerated reportsGenerated initiator reports 1 * 1 * 1..* 1 Figure 2-22, An example of a UML class diagram: classes that participate in the ReportEmergency use case.
19
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19 report_1291incident_1515 bob:FieldOfficer name = “Bob D.” badgeNumber = 132 john:Dispatcher name = “John D.” badgeNumber = 12 alice:FieldOfficer name = “Alice W.” badgeNumber = 23 Figure 2-23, An example of a UML object diagram: objects that participate in the warehouseOnFire scenario.
20
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 20 Figure 2-24, Example of a one-directional association. PolygonPoint **
21
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 21 Incident FieldOfficer name:String badgeNumber:Integer Allocates role:String notificationTime:Time resources incident 1 1..* Figure 2-25, An example of an association class.
22
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 22 Incident FieldOfficer name:String badgeNumber:Integer Allocation role:String notificationTime:Time resources incident1 1..* 1 1 Figure 2-26, Alternative model for Allocation.
23
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 23 ** PoliceStation * * 1 1 1 1 State Directory County PoliceOfficer File Township Figure 2-27, Examples of aggregations.
24
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 24 Figure 2-28, Examples of multiplicity. FieldOfficerIncidentReport * * FireUnitFireTruck * 1 PoliceOfficer 1 1 owner property author report BadgeNumber
25
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 25 Figure 2-29, Example of a hierarhical file system. Directory FileSystemElement File 1 *
26
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 26 Figure 2-30, Example of a nonhierarchical file system. Directory FileSystemElement File * *
27
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 27 Figure 2-31, Example of how a qualified association uses reduces multiplicity. DirectoryFile filename Directory File filename 1 Without qualification With qualification * 0..1 1
28
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 28 EmergencyReport Incident FieldOfficer Dispatcher author initiator reportsGenerated incidents 1 * 1 * 1..* 1 PoliceOfficer name:String badgeNumber:Integer Figure 2-32, An example of a generalization.
29
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 29 Incident assignResource(r) close() Figure 2-33, Examples of operations provided by the Incident class.
30
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 30 :SimpleWatch:Time:Display pressButton1() blinkHours() blinkMinutes() pressButton2() incrementMinutes() refresh() pressButtons1And2() commitNewTime() stopBlinking() pressButton1() :WatchUser Figure 2-34, Example of a sequence diagram: setting the time on 2Bwatch.
31
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 31 abc [i>0] op1() [i<=0] op2() *op3() Figure 2-35, Examples of conditions and iterators in sequence diagrams.
32
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 32 Figure 2-36, Example of a collaboration diagram: Setting the time on 2Bwatch. :2BwatchInput :2BwatchTime :2BwatchDisplay 1:pressButtons1And2() 1.1:blinkHours() 3.1:incrementMinutes() 3.2:refresh() 4.1:commitNewTime() :2BwatchOwner 2:pressButton1() 3:pressButton2() 4:pressButtons1And2() 2.1:blinkMinutes() 4.2:stopBlinking()
33
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 33 ActiveInactiveClosedArchived incidentHandledincidentDocumentedincidentArchived Figure 2-37, A UML statechart diagram for the Incident class.
34
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 34 MeasureTime SetTime pressButtonsLAndR pressButtonsLAndR/beep after 2 min. DeadBattery after 20 years Figure 2-38, Statechart diagram for 2Bwatch set time function.
35
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 35 Figure 2-39, Internal transitions associated with the SetTime state. SetTime entry/blink hours exit/stop blinking pressButton1/blink next number pressButton2/increment current number MeasureTime do/count ticks MeasureTime pressBothButtons pressBothButtons/beep after 2 min. after 20 years
36
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 36 SetTime BlinkHoursBlinkMinutesBlinkSeconds BlinkYearBlinkMonthBlinkDay b2/incr hourb2/incr min. b2/incr sec. b2/incr yearb2/incr mo. b2/incr day b1 Figure 2-40, Refined statechart associated with the SetTime state.
37
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 37 Document Incident Archive Incident Handle Incident Figure 2-41, A UML activity diagram for Incident.
38
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 38 [fire & highPriority] [not fire & highPriority] [lowPriority] Notify Fire Chief Open Incident Notify Police Chief Allocate Resources Figure 2-42, Example of decision in the OpenIncident process.
39
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 39 Archive Incident Open Incident Document Incident Allocate Resources Coordinate Resources Figure 2-43, An example of complex transitions in a UML activity diagram.
40
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 40 Archive Incident Dispatcher FieldOfficer Open Incident Document Incident Allocate Resources Coordinate Resources Figure 2-44, An example of swimlanes in a UML activity diagram.
41
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 41 Report Emergency FieldOfficer Dispatcher OpenIncident AllocateResources ArchiveIncident SearchArchive ManageUsers ManageTerminals LibrarianSysAdmin SysAdministrationIncidentArchive IncidentManagement Figure 2-45, Example of packages: use cases of FRIEND organized by actors.
42
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 42 FieldOfficerDispatcher Librarian SysAdmin IncidentArchive SysAdministration IncidentManagement Figure 2-46, Example of packages.
43
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 43 DispatcherStation EmergencyReportIncident FieldOfficer Dispatcher FieldStation Figure 2-47, Example of packages.
44
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 44 EmergencyReport DispatcherStation Incident FieldOfficer Dispatcher FieldStation The EmergencyReport class is defined in FieldStation and used in both stations. Figure 2-48, An example of a note. Notes can be attached to a specific element in a diagram.
45
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 45 «entity» «boundary» «control» Year Month ChangeDateControl LCDDisplayBoundary ButtonBoundary «entity» Day Figure 2-49, Examples of stereotypes.
46
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 46 EmergencyReport Incident reports 1..* {ordered by time of receipt} Figure 2-50, An example of constraint. 1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.