2023 - CHAP 2 Object Oriented Design Using UML
2023 - CHAP 2 Object Oriented Design Using UML
7/27/2023 2
Also known as Software
Development Lifecycle(SDLC)
A step taken in developing a
software
7/27/2023 3
Waterfallmodel
Agile model
Rational Unified Process(RUP)
..
4
A linear sequential model
Project timeline
5
A incremental model
6
A incremental model
7
8
Standard language for software blueprint
The UML was adopted in 1997 as the
standard for modeling object ‐oriented
systems by the OMG (Object Management
Group, an industry standards body)
A specification defining a graphical
language for visualizing, specifying,
constructing, and documenting the artifacts
of distributed object systems.(Object
Management Group)
https://www.omg.org/spec/UML/2.5.1/PDF
9
Visual language
can be used in developing software
system
Modeling language
a standard language for software
blueprints
has vocabulary and rules for the
purpose of communication.
Models the system as a set of
graphical representation
10
UML is not Programming Language
but a visual modeling language.
UML is not a CASE Tool but a
modeling language specification
UML is not a method, methodology
or software development process but
enable process
11
The UML is a language for:
Visualizing
Visually depict a system
Specifying
Communicate what is required of a
system and how a system may be realize
Constructing
Mapping UML model into programming
language
Documenting
Documenting the artifact of the system,
where artifact include requirement,
design, source code, test etc 12
There are 4 reasons why we use UML
specifically
UML has become the de facto industry
standard
UML unifies the approaches of different
authors in a single notation.
UML can be extended to apply to specific
domains
It is supported by supported by the Unified
Unified Software Software Development
Development Process, which provides a
process model for how it can be applied.
13
static model – use case, class, package,
object, component and deployment
Dynamic model –Sequence,
collaboration, statechart and activity
14
Use Case Diagram
Show a set of use case and actor of a
system
Depict the main function of the
system and different kinds of users
that interact with it
15
16
The actors that the system you are
describing interacts with:
The system itself (system boundary -
the rectangle)
The use cases, or services, that the
system knows how to perform, and
The lines (link) that represent
relationships between these elements.
17
Actor
Is a person or system that interacts
with and derives value from the
system
Is label with its role
Can be associated with other actors
using a generalization relationship.
Are place outside the system
boundary
18
Use Case
Represents a major piece of system
functionality
Can extend another use case
Can use another use case
Is placed inside system boundary
Is labeled with a descriptive verb
‐noun phrase
19
Association
◦ Link an actor with use case
Extends relationship
◦ One use case extends the functionality
of another use case
Includes relationship
◦ One use case will use functionality of
another use case
System boundary
◦ One use case will use functionality of
another use case
20
21
actor Boundary
& system name
Use case
22
23
24
◦ Draw a use case model for a movie
ticketing system where customer can
buy online movie ticket
◦ Identify actor
◦ Identify use case for each actor
25
Class Diagram
is a diagram that shows the classes
and the relationships among
classes that remain constant in the
system over time.
depicts classes, which include
attributes, behaviors and states.
is very similar to the entity
relationship diagram (ERD)
26
27
Class
◦ Represents a kind of person, or thing
◦ Has a name typed centered in its top compartment
◦ Has a list of attributes attributes in its middle
compartment
◦ Has a list of operations in its bottom compartment
28
Class : Account
Attribute : properties that describes the state
of an object
Methods: actions or functions that a class can
perform
Name
Account
- customer_Name
Attributes
- balance
+addFunds( ) Operations
+withDraw( )
+transfer( )
29
Relationship between classes is one of
element in class diagram apart from class
itself.
30
There are three kinds of Relationships
Dependency
Generalization (parent-child relationship)
Association (student enrolls in course)
31
A dependency indicates a semantic relationship between two or
more elements. The dependency from CourseSchedule to Course
exists because Course is used in both the add and remove operations
of CourseSchedule.
CourseSchedule
Course
add(c : Course)
remove(c : Course)
Regular Loyalty
Customer Customer
Subtype1 Subtype2
-Inheritance is a required feature of object orientation
-Generalization expresses a parent/child relationship among related classes.
-Used for abstracting details in several layers
7/27/202
3
7/27/202
3
Student Instructor
Student Instructor
1..*
Student Instructor
1..*
membership
Student Team
1..* 1..*
member of
1..* 1..*
Student Team
1 president of 1..*
Registration
modelNumber
serialNumber
warrantyCode
Product Warranty
0..1 *
employer teacher
Multiplicity Role
Symbol Meaning
1 One and only one Role
0..1 Zero or one “A given university groups many people;
M..N From M to N (natural language)
some act as students, others as teachers.
A given student belongs to a single
* From zero to any positive integer university; a given teacher may or may not
0..* From zero to any positive integer be working for the university at a particular
1..* From one to any positive integer time.”
7/27/202
3
Class Student {
Course enrolls[4];
}
Class Course {
Student have[];
}
7/27/202
3
Scrollbar
1 1
Window Titlebar
1 1
Menu
1 1 .. *
Scrollbar
1 1
Window Titlebar
1 1
Menu
1 1 .. *
51
◦ From the use case model exercise:-
Draw a use case model for a movie
ticketing system where customer can
buy online movie ticket
Identify actor
Identify use case for each actor
Draw a class diagram for movie
ticketing system
52