Lecture 9 - UML Structural Diagrams
Lecture 9 - UML Structural Diagrams
SE-2101 Software
Engineering
Lecture # 09
2
Today’s Agenda
Introduction to UML
UML Structure Diagrams
UML Class Diagram
3
Unified Modeling Language
Everything is fine BUT
How do we use that information to translate our
requirements into a system model?
How do we physically represent that model?
7
History of UML
UML: First Pass
You can model 80% of most problems by using about 20
% UML.
UML Diagrams
11
Note, items in blue are not part of official taxonomy of UML 2.5 diagrams
12
Note, items in blue are not part of official taxonomy of UML 2.5 diagrams
Structure Diagrams
• Structure diagram shows the static structure of
the system and how those parts are related to each
other.
• Structure diagrams are not utilizing time-related
concepts, and do not show the details of dynamic
behavior.
UML Class Diagram
UML Class Diagram
operations
Person
name : String
• In the class diagram, attributes
address : Address appear in the second compartment
birthdate : Date just below the name-compartment.
cnic : Id
Public +
Private -
Protected #
Derived /
Visibility
• Public visibility allows unrestricted access to the
class's attributes and operations from any other
class or object
• Private visibility restricts access to only the
methods and attributes within the same class.
Other classes or objects cannot access these
members directly.
• Protected visibility allows access to the members
from within the class itself and from subclasses
(inheritance), but not from unrelated classes.
Class Operations
Operations define the behavior or
methods that an object of the class can
ClassName perform. They represent the functions
that can be called on objects of the class.
attributes Operations are typically depicted as a
name, a list of parameters (if any), and a
return type (if the operation returns a
operations
value).
For the same "Car" class, you might
have operations such as:
•startEngine(): void (to start the car's
engine)
•stopEngine(): void (to stop the car's
engine)
Software Design (UML)
Class Operations
Person
name : String
address : Address
birthdate : Date
cnic : Id
ClassName
attributes
operations
Person Person
Person
name : String
birthdate : Date
Person ssn : Id
Student Instructor
1..*
membership
Student Team
1..* 1..*
member of
1..* 1..*
Student Team
1 president of 1..*
Base Class
Derived Class
/ age : Date
44
Case Study
First of all, Order and Customer are identified as the two
elements of the system.
They have a one-to-many relationship because a
customer can have multiple orders.
Order class is an abstract class and it has two concrete
classes (inheritance relationship) SpecialOrder and
NormalOrder.
The two inherited classes have all the properties as the
Order class. In addition, they have additional functions
like dispatch () and receive ()
45
Case Study - Solution
46
The End.
47