IBM Software Group
IBM Software Group
IBM Software Group
Content:
Principle of Visual Modelling Concepts of Object Orientation Use-Case Modeling Object Interaction and Interaction Diagrams Class Diagrams Others
Why Model?
Modeling achieves four aims:
Helps you to visualize a system as you want it to be. Permits you to specify the structure or behavior of a system. Gives you a template that guides you in constructing a system. Documents the decisions you have made.
You build models of complex systems because you cannot comprehend such a system in its entirety. You build models to better understand the system you are developing.
4
Process and Visual Modeling - What Type of Development Process Most Benefits the UML?
The UML is largely process independent. A process fully benefits from the UML when the process is:
Use-case driven Architecture centric Iterative and incremental
Review
What is a model? What are the viewpoints of MDA? Describe each one. What are the four principles of modeling? Describe each one. What is the UML? Describe each of its four benefits. What process characteristics best fit the UML? Describe each characteristic. What is an iteration?
9
10
Object
Object Orientation
Encapsulation
Abstraction
Modularity
12
Hierarchy
What Is Abstraction?
The essential characteristics of an entity that distinguishes it from all other kinds of entities. Defines a boundary relative to the perspective of the viewer. Is not a concrete manifestation, denotes the ideal essence of something.
13
What Is Encapsulation?
Hides implementation from clients.
Clients depend on interface.
Improves Resiliency
14
What Is Modularity?
Breaks up something complex into manageable pieces. Helps people understand complex systems.
15
What Is Hierarchy?
Increasing abstraction Asset
BankAccount
Security
RealEstate
Decreasing abstraction
Savings
Checking
Stock
Bond
Elements at the same level of the hierarchy should be at the same level of abstraction.
16
What Is a Class?
A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.
An object is an instance of a class.
17
18
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 in which a subclass inherits from one or more superclasses.
Single inheritance. Multiple inheritance.
Is an is a kind of relationship.
19
What Is Inherited?
A subclass inherits its parents attributes, operations, and relationships. A subclass may:
Add additional attributes, operations, relationships. Redefine inherited operations. (Use caution!)
Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy.
Inheritance leverages the similarities among classes.
20
Use-Case Modeling
Concepts in use-case modeling Use-case diagrams Activity diagrams
21
23
What Is an Actor?
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 not part of the system.
Actors are EXTERNAL.
Actor
24
25
Course Catalog
Register for Courses Maintain Professor Information
Student
Login Maintain Student Information
Registrar
Select Courses to Teach Close Registration
Professor
Submit Grades
Billing System
26
27
1. The system checks to see if registration is in progress. If it is, then a message is displayed to the Registrar and the use case terminates. The Close Registration processing cannot be performed if registration is in progress.
2. For each course offering, the system checks if a professor has signed up to teach the course offering and at least three students have registered. If so, the system commits the course offering for each schedule that contains it.
Activity 2
Activity 1
Activity 3
28
What Is an Activity?
A specification of behavior expressed as a flow of execution via sequencing of subordinate units.
Subordinate units include nested activities and ultimately individual actions.
May contain boolean expression constraints when the activity is invoked or exited
Activity 2 <<Precondition>> Boolean constraint Activity 4
Activity 5
29
Concurrent Threads
[ add course ]
Activity/Action
[ delete course ]
Delete Course
[ checks completed ]
[ checks failed ]
Resolve Conflicts
30
2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) 5: display course offerings( ) 6: display blank schedule( )
ref
Select Offerings
32
Communication Diagrams
33
Links
: Course Catalog
: Student
Actors
: RegistrationController
: CourseCatalogSystem
34
Communication diagrams
Show relationships in addition to interactions Better for visualizing patterns of communication Better for visualizing all of the effects on a given object Easier to use for brainstorming sessions
35
Class Diagrams
Class diagrams Class relationships
Association Aggregation Generalization
36
: RegisterForCoursesForm
: Student
: RegistrationController
8: any conflicts?( )
3: save( ) 4: submit( )
: Schedule
6: has pre-requisites(CourseOffering)
: CourseOffering : Student
5: is selected?( ) 10: mark as enrolled in( )
: PrimaryScheduleOfferingInfo
37
RegisterForCoursesForm
RegistrationController
0..1 1
Student Schedule
0..*
CourseOffering
0..*
0..4
38
Animal
Airplane
Helicopter
Bird
Wolf
Horse
Use multiple inheritance only when needed and always with caution!
39
UML
() . , , , , . . ( / ) . , , , () .
- , (, ...) ( ) , .
(UML 2.2) , ,
40
UML ()
1. -. 2. (activity) , 3. ( , , , ..) 4. 5. ()
41
, ,
42
43