System modeling
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.
The position of the system boundary has a profound
effect on the system requirements.
UML diagram types
UML has become a standard modelling language
Use case diagrams, which show the interactions
between a system and its environment.
Sequence diagrams, which show interactions
between actors and the system and between system
components.
Class diagrams, which show the object classes in
the system and the associations between these
classes.
State diagrams, which show how the system reacts
to internal and external events.
Activity diagrams, which show the activities
involved in a process or in data processing .
Interaction models
All systems involve interaction of some kind. This can be
user interaction, which involves user inputs and outputs,
interaction between the system being developed and other
systems or
interaction between the components of the system.
Modeling user interaction is important as it helps to identify
user requirements.
Modeling system-to-system interaction highlights the
communication problems that may arise.
Modeling component interaction helps us understand if a
proposed system structure is likely to deliver the required
system performance and dependability.
Use case diagrams and sequence diagrams may be used for
interaction modelling.
Use case modeling
Use cases were developed originally to support
requirements elicitation and now incorporated into
the UML.
Each use case represents a discrete task that
involves external interaction with a system.
Actors in a use case may be people or other
systems.
A use case is shown as an ellipse with the actors
involved in the use case represented as stick
figures
Represented diagrammatically to provide an
overview of the use case and in a more detailed
textual form.
Online Shopping System use cases example
The Online Shopping system facilitates the customer to view the
products, inquire about the product details, and product availability. It
allows the customer to get register in order to purchase products. The
customer can search products by browsing different product categories
or by entering search keywords. Customer can place order and pay
online. There are two acceptable payment methods. These are (1) pay
by credit card and (2) pay by PayPal.
The system provide service to seller to place the products for selling.
The seller creates account to become the member and places his
products under suitable product category.
The systems allows the administrator to manage the products. It
facilitates the administrator to modify the existing products categories or
to add new products categories.
The system facilitate site manager to view different reports including (1)
order placed by customers, (2) products added by sellers, and (3)
accounts created by users.
Online Shopping System
Stakeholders and associated use cases
Customer
view the products
inquire about the product details
inquire about products availability
get register
purchase products
search products
by category
by keyword
pay online
pay by credit card
pay by paypal
Online Shopping System
Stakeholders and associated use cases
Seller
place the products for selling
create account
place products product category
Administrator
Manage products
modify the existing products categories
add new products categories
Site manager
view order placed by customers
view products added by sellers,
view accounts created by users.
Transfer-data use case
A use case in the MHC-PMS
Tabular description of the
‘Transfer data’ use-case
MHC-PMS: Transfer data
Actors Medical receptionist, patient records system (PRS)
Description A receptionist may transfer data from the MHC-PMS to a
general patient record database that is maintained by a
health authority. The information transferred may either
be updated personal information (address, phone
number, etc.) or a summary of the patient’s diagnosis
and treatment.
Data Patient’s personal information, treatment summary
Stimulus User command issued by medical receptionist
Response Confirmation that PRS has been updated
Comments The receptionist must have appropriate security
permissions to access the patient information and the
PRS.
Use cases in the MHC-PMS involving the role
‘Medical Receptionist’
Use cases for the MHC-PMS
Actor and Use Case Diagram
Use Cases and Actors
Use Case Diagram : Online Hotel
Reservation
Include and extends
Include is used for use case that are in
the flow of events of main use case.
Extends is used for exceptional
conditions.
Use case “<<include>>” example
Relationship Between Use Cases
<<extends>>
<<include>> and <<extend>>
USE Case: Online Auction
Sequence Diagrams
Sequence diagrams are part of the UML
and are used to model the interactions
between the actors and the objects
within a system.
A sequence diagram shows the
sequence of interactions that take place
during a particular use case.
Sequence Diagram Key Parts
S.D (Make a Phone Call)
ATM
Transaction
Sequence Diagram Tutorial
https://www.smartdraw.com/sequence-d
iagram/
https://www.youtube.com/watch?
v=zLUOxlV2FGc
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 Diagram
Class diagram shows:
The system's classes
their attributes
operations (or methods)
and the relationships among objects.
Class diagram usability
In the design of a system, a number of
classes are identified and grouped
together in a class diagram that helps to
determine the static relations between
them.
With detailed modelling, the classes of
the conceptual design are often split
into a number of subclasses.
Class Visibility in UML
To specify the visibility of a class member (i.e. any attribute or method), these notations must be placed
before the member's name
+ Public
- Private
# Protected
Derived (can be combined with one of the
/
others)
~ Package
Multiplicity
0 No instances (rare)
0..1 No instances, or one instance
1 Exactly one instance
1..1 Exactly one instance
0..* Zero or more instances
* Zero or more instances
1..* One or more instances
UML Association
An association represents a family of
links. An association can link any
number of classes.
Types of association:
1. Binary: Link 2 classes
Aggregation
Composition
2. N-ary: Link N classes
Aggregation and Composition
A relationship between two objects is referred as an
association
an association is known as composition when one
object owns other(part-whole)
University and Departments
an association is known as aggregation when one
object uses another object. (has-A)
Library and Students. Here the student can exist without
library, the relation between student and library is
aggregation.
Aggregation example
Pond Duck
Office Chair
Composition example
Person
Leg Hand
Company Department
UML Relation Notations
UML classes and association
Show how many objects are involved in the
association
That is, each patient has exactly one record and each
record
maintains information about exactly one patient
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
Registration #
Register ()
De-re gister ()
Reader Borrower
Affiliation Items on loan
Max. loans
Staff Student
Department Major subject
Department phone Home ad dress