Professional Documents
Culture Documents
5.1 System Modeling P1
5.1 System Modeling P1
Customer
Order meal Update Restaurant
menu Manager
Deliver meal
System boundaries
System boundaries are established to define what is
inside and what is outside the system.
They show other systems that are used or depend
on the system being developed.
https://www.smartdraw.com/sequence-
diagram/
Structural models
Structural models of software display the organization
of a system in terms of the components that make
up that system and their relationships.
You create structural models of a system when you
are discussing and designing the system
architecture.
Class diagrams
Class diagrams are used when developing an object-
oriented system model to show the classes in a
system and the associations between these classes.
An object class can be thought of as a general
definition of one kind of system object.
When you are developing models, objects represent
something in the real world, such as a patient, a
prescription, doctor, etc.
An association is a link between classes that indicates
that there is some relationship between these classes.
UML classes and association
1 teaches *
Teacher Student One- to-many
1 has 3
Tricycle wheels One -to -three
1 holds 12,24
Eggbox Egg One- to-12 or 24
Classes and associations in Bank
Bank
1 maintains 1
ATM
1 0..*
ATM
1
performs transaction
has
1…*
Customer
1
1…*
Provide access to
Account 1 1
Debit card
UML class examples with attributes and operations
Generalization
Generalization is an everyday technique that
we use to manage complexity.
Rather than learn the detailed characteristics
of every entity that we experience, we place
these entities in more general classes
(animals, cars, houses, etc.) and learn the
characteristics of these classes.
This allows us to infer that different members
of these classes have some common
characteristics
Generalization
One class (the child class or subclass) can inherit
attributes and operations from another (the parent
class or superclass). The parent class is more
general than the child class.
The lower-level classes are subclasses inherit the
attributes and operations from their superclasses.
These lower-level classes then add more specific
attributes and operations.
The inheritance hierarchy doesn't have to end at two
levels: A child class can be a parent class for still
another child class.
Generalization example
Attributes: Weight, passenger capacity, fuel tank
capacity, colour, registration number, engine
properties
Operation: startEngine(), stopEngine(),
applyBrake(), accelerate()
Number of wheels
NumOfdoors
SwitchACON(),
SwitchACOFF()
Generalization example
A generalization hierarchy with
added detail
Library User class hierarchy
Library user
Name
Address
Phone
Reg istration #
Reg ister ()
De-reg ister ()
Reader Borrower
Affiliation Items on loan
Max. loans
Staff Student
Depar tment Major subject
Depar tment phone Home ad dress
Aggregation
Aggregation is a specialized form of Association where all objects
have their own lifecycle, but there is ownership and child objects
can not belong to another parent object.
Let's take an example of Department and teacher. A single teacher
can not belong to multiple departments, but if we delete the
department, the teacher object will not be destroyed.
Aggregation is a "has a" association relationship
In UML, it is graphically represented as a hollow diamond shape on
the containing class with a single line that connects it to the
contained class.
Aggregation example
Pond Duck
Office Chair
Composition
Composition is again specialized form of
Aggregation and we can call this as a “death”
relationship. It is a strong type of Aggregation. Child
object does not have its lifecycle and if parent object
is deleted, all child objects will also be deleted.
Let's take again an example of relationship between
House and Rooms. House can contain multiple
rooms - there is no independent life of room and any
room can not belong to two different houses. If we
delete the house - room will automatically be deleted.
Composition relationship is drawn like the
aggregation relationship, but this time the diamond
shape is filled
Composition example
Person
Leg Hand
Company Department