Академический Документы
Профессиональный Документы
Культура Документы
Agenda
What is Model? Why do we Model? Importance of Modeling? Four principles of Modeling? UML History of the UML UML Diagrams Activity Diagram Use Case Diagram Sequence Diagram Collaboration Diagram Class Diagram State Diagram Component Diagram Deployment Diagram
2
What Is a Model?
A model is a simplification of reality.
Why Do We Model?
Modeling achieves four aims:
Helps us to visualize a system as we want it to be. Permits us to specify the structure or behavior of a system. Gives us a template that guides us in constructing a system. Documents the decisions we have made.
We build models of complex systems because we cannot comprehend such a system in its entirety. We build models to better understand the system we are developing.
Paper Airplane
Fighter Jet
Business Analyst
Software Engineer
Data Models
Database Designer
11
Principle 3: The Best Models Are Connected to Reality All models simplify reality. A good model reflects potentially fatal characteristics.
12
Implementation View
End-user Functionality
Deployment View
System engineering System topology delivery, installation communication
13
Fusion
Harel
State charts
Embley
Singleton classes, high -level view
Gamma, et.al
Frameworks, patterns, notes Shlaer - Mellor Object lifecycles
Wirfs-Brock
Odell
Classification
Responsibilities
15
UML 2.0
UML 1.4
UML 1.3 UML 1.1 UML 1.0 UML 0.9 Unified Method 0.8
UML partners
Web - June 1996 OOPSLA 95
Other methods
OOSE
16
Booch method
OMT
17
19
20
Domain Expert
Use Case 1
[yes] Actor B
Actor A
Use Case 2
Deployment Diagram
- 95 : - NT: - : , - IBM : , Window95 Windows95 Windows95
Use Case 3
.EXE
9: sortByName ( )
Class Diagram
DocumentList FileMgr Document add( ) delete( ) name : int docid : int numField : int get( ) open( ) close( ) read( ) sortFileList( ) create( ) fillDocument( ) Windows NT fetchDoc( ) sortByName( ) read() fill the code.. 4: create ( ) 8: fillFile ( )
Windows NT
Solaris
mainWnd : MainWnd
1: Doc view request ( ) L
IBM Mainframe
2: fetchDoc( )
gFile : GrpFile
Repository FileManager
Document
GrpFile
read( )
GraphicFile
File
FileList
fileMgr : FileMgr
document : Document
gFile
repository
2: fetchDoc( ) 3: create ( )
4: create ( )
5: readDoc ( )
6: fillDocument ( )
7: readFile ( )
8: fillFile ( ) . 9: sortByName ( )
Model space
Sequence Diagram
Executable System
O-O Analysis
Iteration an d R eu se
Using TOOLS CASE and/or OO programing languages User satisfaction Usability & QA Tests
O-O
Implementation
O-O Design
22
Withdraw Money
23
An Architecture-Centric Process
A systems architecture is used as a primary artifact for conceptualizing, constructing, managing, and evolving the system under development. Benefits:
Intellectual control over a project to manage its complexity and to maintain system integrity. Effective basis for large-scale reuse. A basis for project management. Assistance in component-based development.
24
25
Iterative Development
Iteration 1
R
Iteration 2
R D
Iteration 3
R D
D
C I T
C
I T
C
I T
T I M E
Earliest iterations address greatest risks. Each iteration produces an executable release, an additional increment of the system. Each iteration includes integration and test.
26
UML Diagrams
Use case Activity Sequence Collaboration Class State chart Object Component Deployment
27
28
29
Student
Login
30
Used to identify
Who interacts with the system and what the system should do The requirements for the system interfaces
Used to verify
All requirements have been captured The development team understands the requirements
31
Actor
Use Case
32
What Is an Actor?
Actors are not part of the system. Actors represent roles a user of the system can play. They can represent a human, a machine, or another system. They can actively interchange information with the system. They can be a giver of information. They can be a passive recipient of information. Actors are EXTERNAL.
Actor
33
Use Case
34
Actor
Communicate-association
Use Case
35
Login
Maintain Student Information
Submit Grades
Close Registration
Billing System
36
Use
Case
Diagram
Example
Use Case Diagram Example for College Registration System A student may register for classes during a specified registration period. To register, a student must see their advisor. The advisor must approve each course that the student has selected. The advisor will use the registration system to determine if the student has met the course prerequisites, is in good academic standings and is eligible to register.
37
If the advisor approves the courses, the advisor enters the student's college id into the course registration system. The course registration number for each course is entered. The course description, course number and section for those courses will automatically display. The system will check for schedule conflicts before saving the registrations. A bill for the courses will print in the Bursar's office. The student should proceed to pick it up.
38
Faculty can use the registration system to check enrolments in their classes, get a class list, check a student's transcript, look up a student's phone number and other such student information. The registrar can use the registration system to enter new classes for an upcoming semester, cancel a class, and check conflicts in classroom/faculty assignments. Admissions use the registration system to add new students. Enrolment services use the registration system to report on retention, update student information, and check fulfilment of graduation requirements for those students planning to graduate.
39
40
41
An activity state represents the performance of an activity or step within the workflow.
42
[ delete course ]
Delete Course
Activity State
Select Course
Concurrent threads
Check Pre-requisites
[ checks completed ]
[ checks failed ]
Assign to course
[ student added to the course ]
Resolve conflicts
Update schedule
43
Swimlanes
Sales Fulfillment
Determine Need
Take Order
Deliver Order
44
Objectives
Describe dynamic behavior and show how to capture it in a model. Demonstrate how to read and interpret
a collaboration diagram. a sequence diagram.
Explain the similarities and differences between collaboration and sequence diagrams.
45
46
47
Sequence Diagrams
Collaboration Diagrams
48
Sequence Diagrams
49
: Student
: :RegistrationController
1: create schedule( ) 2: get course offerings( ) 3: get course offerings(forSemester) 4: get course offerings( ) 5: display course offerings( )
50
Anonymous Objects
51
Actor instances
52
Reflexive Messages
Message
6: display blank schedule( )
53
Focus of Control
54
Collaboration Diagrams
55
: Course Catalog
: Student
2: get course offerings( ) 4: get course offerings( ) 3: get course offerings(forSemester) : RegistrationController : CourseCatalogSystem
56
: RegisterForCoursesForm
Objects
: RegistrationController
57
: RegisterForCoursesForm
: RegistrationController
58
: Course Catalog
: Student
2: get course offerings( ) 4: get course offerings( ) 3: get course offerings(forSemester) : RegistrationController : CourseCatalogSystem
59
60
Sequence diagrams
Show the explicit sequence of messages Better for visualizing overall flow Better for real-time specifications and for complex scenarios
61
Objectives
Describe the static view of the system and show how to capture it in a model. Demonstrate how to read and interpret a class diagram. Model an association and aggregation and show how to model it in a class diagram. Model generalization on a class diagram.
62
Schedule
CloseRegistrationController
Student
+ get tuition() + add schedule() + get schedule() + delete schedule() + has pre-requisites()
+ commit() + select alternate() + remove offering() + level() + cancel() + get cost() + delete() + submit() + save() + any conflicts?() + create with offerings() + update with new selections()
64
Schedule CloseRegistrationForm
CloseRegistrationController
Registration
CloseRegistrationForm
CloseRegistrationController
RegisterForCoursesForm
RegistrationController
67
What Is an Association?
The semantic relationship between two or more classifiers that specifies connections among their instances. A structural relationship specifying that objects of one thing are connected to objects of another.
<<entity>> Student <<entity>> Schedule <<entity>> Course
68
: Student
: Student
: RegisterForCoursesForm
8: any conflicts?( )
3: save( ) 4: submit( )
:Schedule
6: has pre-requisites(CourseOffering)
:CourseOffering :Student
5: is selected?( ) 10: mark as enrolled in( )
:PrimaryScheduleOfferingInfob
69
What Is Multiplicity?
Multiplicity is the number of instances one class relates to ONE instance of another class. For each association, there are two multiplicity decisions to make, one for each end of the association.
For each instance of Professor, many Course Offerings may be taught. For each instance of Course Offering, there may be either one or zero Professor as the instructor.
<<entity>> instructor Professor 0..1 <<entity>> CourseOffering 0..*
70
Multiplicity Indicators
Unspecified Exactly one Zero or more (many, unlimited)
1 0..* *
One or more Zero or one (optional scalar role) Specified range Multiple, disjoint ranges
71
1..* 0..1
2..4 2, 4..6
Example: Multiplicity
<<boundary>> RegisterForCoursesForm 1 1 0..1 <<control>>
RegistrationController
<<entity>> Student
1 0..*
<<entity>> CourseOffering
0..4
72
What Is Aggregation?
An aggregation is a special form of association that models a whole-part relationship between an aggregate (the whole) and its parts.
An aggregation is an is a part-of relationship.
73
Example: Aggregation
<<boundary>> RegisterForCoursesForm 1 1 0..1 <<control>>
RegistrationController
<<entity>> Student
1 0..*
<<entity>> CourseOffering
0..4
74
What Is Generalization?
A relationship among classes where one class shares the structure and/or behavior of one or more classes Defines a hierarchy of abstractions where a subclass inherits from one or more superclasses
Single inheritance Multiple inheritance
Is an is a kind of relationship
75
Superclass (parent)
Generalization Relationship
Savings
Checking
Subclasses Descendents
76
Animal
Airplane
Helicopter
Bird
Wolf
Horse
Use multiple inheritance only when needed and always with caution!
77
Name: J Clark Employee ID: 567138 Date Hired: July 25, 1991 Status: Tenured Discipline: Finance Maximum Course Load: 3 classes
Name: J Clark Employee ID: 567138 HireDate: 07/25/1991 Status: Tenured Discipline: Finance MaxLoad: 3
Professor Clark
78
Sample State 1
79
Sample State 2
Drawing States
A state is represented as a rounded rectangle on a statechart diagram. As a comparison, note the subtle difference between a state versus an activity.
Sample State 1
Sample Activity
80
Special States
The initial state is the state entered when an object is created.
An initial state is mandatory. Only one initial state is permitted. The initial state is represented as a solid circle.
81
82
A transition may take place in response to an event. Transitions can be labeled with events.
Event State A State B
Transition
83
Example: Statechart
Applied
[ accepted ] Enrolled
[ rejected ]
Freshman First year
Graduated
84
85
What Is a Component?
A modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces. It conforms to and provides the physical realization of a set of interfaces.
86
Component A Interface
Component B
87
88
What Is a Node?
Physical run-time computational resource Types
Processor Node <<Node>> Node #1 Executes system software Device Node Support device Typically controlled by a processor
89
What Is a Connector?
Connection
Communication mechanism Physical medium Software protocol
<<Processor>> Processor #1
Connection
<<Device>> Device #1
90
Registration Server
<<Campus LAN>>
<<Campus LAN>>
91
Questions
92
Thank you
93