0% found this document useful (0 votes)
626 views55 pages

Chapter 5: System Modeling

The document discusses system modeling and provides examples of different types of models, including: 1) Context models which show the environment and systems around a system boundary. 2) Interaction models like use case and sequence diagrams which depict interactions between a system and external actors. 3) Structural models that represent the organization and relationships within a system. Behavioral models are also mentioned as showing the dynamic behavior of a system. The document gives examples of each type of model using a mental health care patient management system.

Uploaded by

nabaraj negi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
626 views55 pages

Chapter 5: System Modeling

The document discusses system modeling and provides examples of different types of models, including: 1) Context models which show the environment and systems around a system boundary. 2) Interaction models like use case and sequence diagrams which depict interactions between a system and external actors. 3) Structural models that represent the organization and relationships within a system. Behavioral models are also mentioned as showing the dynamic behavior of a system. The document gives examples of each type of model using a mental health care patient management system.

Uploaded by

nabaraj negi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 55

Chapter 5 : System modeling

1
Objectives
•Understand how graphical models can be used to represent Software
systems and why several types of model are needed to Fully represent a
system;
•Understand the fundamental system modeling perspectives of Context,
interaction, structure, and behavior;
•Understand the principal diagram types in the unified modeling Language
(UML) and how these diagrams may be used in system Modeling;
•Have been introduced to model-driven engineering, where an Executable
system is automatically generated from structural and Behavioral models.

2
Topics Covered
• Introduction to System Modeling
•Context models
•Interaction models
•Structural models
•Behavioral models
•Model-driven engineering

3
System modeling

•System modeling is the process of developing abstract models of a


system, with each model presenting a different view or perspective of that
system.
•System modeling has now come to mean representing a system using
some kind of graphical notation, which is now almost always based on
notations in the Unified Modeling Language (UML).
•System modelling helps the analyst to understand the functionality of the
system and models are used to communicate with customers.

4
Existing and planned system models

•Models of the existing system are used during requirements engineering.


They help clarify what the existing system does, and they can be used to
focus a stakeholder discussion on its strengths and weaknesses.
•Models of the new system are used during requirements engineering to help
explain the proposed requirements to other system stakeholders. Engineers
use these models to discuss design proposals and to document the system for
implementation.
•In a model-driven engineering process, it is possible to generate a complete
or partial system implementation from the system model.

5
Models can explain the system from different perspectives:

•An external perspective, where you model the context or environment of


the system.
•An interaction perspective, where you model the interactions between a
system and its environment, or between the components of a system.
•A structural perspective, where you model the organization of a system or
the structure of the data that is processed by the system.
•A behavioral perspective, where you model the dynamic behavior of the
system and how it responds to events.

6
Five types of UML diagrams that are the most useful for system modeling:

•Activity diagrams, which show the activities involved in a process or in data


processing.
•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.

7
1. Context models

• Context models are used to illustrate the operational context of a system -


they show what lies outside the system boundaries.

• Social and organizational concerns may affect the decision on where to


position system boundaries.

• Architectural models show the system and its relationship with other
systems.

8
• 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.

• Defining a system boundary is a political judgment


• There may be pressures to develop system boundaries that increase /
decrease the influence or workload of different parts of an
organization.

9
• This system is intended to manage information about patients attending
mental health clinics and the treatments that have been prescribed.
• You have to decide whether the system should focus exclusively on
collecting information about consultations (using other systems to collect
personal information about patients) or whether it should also collect
personal patient information.
• The advantage of relying on other systems for patient information is that
you avoid duplicating data.
• The major disadvantage, however, is that using other systems may make it
slower to access information, and if these systems are unavailable.

10
Figure 5.1.The context of the MHC-PMS

11
Process perspective
•Context models simply show the other systems in the environment, not how the
system being developed is used in that environment.

•Process models reveal how the system being developed is used in broader
business processes.

•UML activity diagrams may be used to define business process models.

•Arrows represent the flow of work from one activity to another, and a solid bar
indicates activity coordination, condition checks, start of process, process
termination.

12
Process model of involuntary detention

Figure 5.2. Activity diagram that show where the Mentcare system is used in an important mental health care
13
process—involuntary detention.
2. Interaction models

• 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
modeling.

14
Use case modeling
•Use case modeling, which is mostly used to model interactions between a
system and external agents (human users or other systems).

•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.

•Represented diagrammatically to provide an overview of the use case and in a


more detailed textual form.

•We are quite familiar with Use Cases and their models.

15
Figure 5.3.Transfer-data use case

• Use case diagrams give a simple overview of an interaction, and you need
to add more detail for complete interaction description. This detail can
either be a simple textual description, a structured description in a table,
or a sequence diagram.
• Tabular description of the “Transfer data” use case as below.

16
Figure 5.4. Tabular description of the Transfer-data use case

17
• Composite use case diagrams show a number of different use cases.
Sometimes it is possible to include all possible interactions within a system
in a single composite use case diagram.
• In such cases, you may develop several diagrams, each of which shows
related use cases.
• Following figure shows all of the use cases in the Mentcare system in
which the actor “Medical Receptionist” is involved with more detailed
description.

18
Figure 5.5. Use cases involving the role “Medical receptionist”
19
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 and the
interactions between the objects themselves.

•A sequence diagram shows the sequence of interactions that take place


during a particular use case or use case instance.
•The objects and actors involved are listed along the top of the diagram,
with a dotted line drawn vertically from these.
•Annotated arrows indicate interactions between objects.

20
Figure 5.6. Sequence diagram for View patient information

21
• The medical receptionist triggers the ViewInfo method in an instance P of the
PatientInfo object class, supplying the patient’s identifier, PID to identify the
required information. P is a user interface object, which is displayed as a form
showing patient information.
• The instance P calls the database to return the information required, supplying the
receptionist’s identifier to allow security checking. (At this stage, it is not important
where the receptionist’s UID comes from.)
• The database checks with an authorization system that the receptionist is authorized
for this action.
• If authorized, the patient information is returned and is displayed on a form on the
user’s screen. If authorization fails, then an error message is returned. The box
denoted by alt in the top-left corner is a choice box indicating that one of the
contained interactions will be executed. The condition that selects the choice is
shown in square brackets.

22
Figure 5.7. Sequence diagram for Transfer Data 23
• Sequence diagram from the same system that illustrates two additional features. These
are the direct communication between the actors in the system and the creation of
objects as part of a sequence of operations.
• This example, an object of type Summary is created to hold the summary data that is
to be uploaded to a national PRS (patient records system).

read this diagram as follows:


1. The receptionist logs on to the PRS.
2. Two options are available (as shown in the “alt” box). These allow the direct
transfer of updated patient information from the Mentcare database to the PRS and
the transfer of summary health data from the Mentcare database to the PRS.
3. In each case, the receptionist’s permissions are checked using the authorization
system.

24
4. Personal information may be transferred directly from the user interface object to the
PRS. Alternatively, a summary record may be created from the database, and that
record is then transferred.
5. On completion of the transfer, the PRS issues a status message and the user logs off.

25
3. 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.

• Structural models may be static models, which show the structure of the
system design, or dynamic models, which show the organization of the
system when it is executing.

• You create structural models of a system when you are discussing and
designing the system architecture.

• The structure model never describes the dynamic behavior of the system,
So, class diagram widely used.

26
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.

• Associations denote relationships between classes.

• The multiplicity of an association end denotes how many objects the


source object can legitimately reference.

• When you are developing models during the early stages of the software
engineering process, objects represent something in the real world, such as
a patient, a prescription, doctor, etc.

27
Figure 5.8. Multiplicity

Figure 5.9. UML classes and association

28
Figure 5.10. Classes and associations in the Mentcare system

29
Figure 5.11. A Consultation class

30
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. For example, squirrels and rats are members of the
class “rodents,” and so share the characteristics of rodents.
• Generalization is a mechanism for combining similar classes of objects
into a single, Generalization is a mechanism for combining similar classes
of objects into a single,  

31
Generalization
• In modeling systems, it is often useful to examine the classes in a system to see if
there is scope for generalization. If changes are proposed, then you do not have to
look at all classes in the system to see if they are affected by the change.

• In object-oriented languages, such as Java, generalization is implemented using


the class inheritance mechanisms built into the language.

• In a generalization, the attributes and operations associated with higher-level


classes are also associated with the lower-level classes.

• The lower-level classes are subclasses inherit the attributes and operations from
their super classes. These lower-level classes then add more specific attributes and
operations.

• Specialization is a process in which an entity is divided into sub-entities.

32
Figure 5.12. A generalization hierarchy

33
Figure 5.13. A generalization hierarchy with added detail

34
Object class Aggregation models

• The UML provides a special type of association between classes called


aggregation, which means that one object (the whole) is composed of other
objects (the parts).
• To define aggregation, a diamond shape is added to the link next to the
class that represents the whole.
• 'Has-a' relationship

Figure 5.14 .The aggregation association


35
                                        
• Aggregation and Composition are subsets of association meaning they
are specific cases of association.
• Aggregation implies a relationship where the child can exist independently
of the parent. Example: Class (parent) and Student (child). Delete the Class
and the Students still exist.
• Composition implies a relationship where the child cannot exist
independent of the parent. Example: House (parent) and Room (child).
Rooms don't exist separate to a House.
• 'Is-a' relationship

36
4. Behavioral models

• Behavioral models are models of the dynamic behavior of a system as it is


executing. They show what happens or what is supposed to happen when a
system responds to a stimulus from its environment.

• You can think of these stimuli as being of two types:

• Data becomes available that has to be processed by the system. The


availability of the data triggers the processing.
• An event happens that triggers system processing. Events may have
associated data, although this is not always the case.

37
Data-driven modeling

• Many business systems are data-processing systems that are primarily driven
by data.
• They are controlled by the data input to the system, with relatively little
external event processing. Their processing involves a sequence of actions on
that data and the generation of an output.
• For example, a phone billing system will accept information about calls made
by a customer, calculate the costs of these calls, and generate a bill for that
customer.
• This is also know as Data-flow diagrams(DFDs) can be represented in the
UML using the activity diagram type.
38
Figure 5.15. Order processing DFD

39
• Data-flow models are useful because tracking and documenting how data
associated with a particular process moves through the system help analysts
and designers understand what is going on in the process.
• Figure 5.15 shows simple activity diagram that shows the chain of processing
involved in the insulin pump software.
• Activities represented as (rounded rectangles),and the data flowing between
these steps, represented as objects (rectangles).
• An alternative way of showing the sequence of processing in a system is to use
UML sequence diagrams.
• Figure 5.16 illustrates this, using a sequence model of processing an order and
sending it to a supplier.

40
Figure 5.16. Order processing

41
Event-driven modeling

• Introduced in Real-time systems are often event-driven, with minimal data


processing.

• For example, a landline phone switching system responds to events such as


‘receiver off hook’ by generating a dial tone.

• Event-driven modeling shows how a system responds to external and


internal events.

• It is based on the assumption that a system has a finite number of states and
that events (stimuli) may cause a transition from one state to another.

42
State machine models

•These model the behavior of the system in response to external and internal
events.

•They show the system’s responses to stimuli so are often used for modeling
real-time systems.

•State machine models show system states as nodes and events as arcs
between these nodes. When an event occurs, the system moves from one
state to another.

•State charts are an integral part of the UML and are used to represent state
machine models.

43
Figure 5.17. A State diagram of a microwave oven

44
States and stimuli for the microwave oven (a)

State Description

Waiting The oven is waiting for input. The display shows the current time.

Half power The oven power is set to 300 watts. The display shows ‘Half power’.

Full power The oven power is set to 600 watts. The display shows ‘Full power’.

Set time The cooking time is set to the user’s input value. The display shows
the cooking time selected and is updated as the time is set.
Disabled Oven operation is disabled for safety. Interior oven light is on. Display
shows ‘Not ready’.
Enabled Oven operation is enabled. Interior oven light is off. Display shows
‘Ready to cook’.
Operation Oven in operation. Interior oven light is on. Display shows the timer
countdown. On completion of cooking, the buzzer is sounded for five
seconds. Oven light is on. Display shows ‘Cooking complete’ while
buzzer is sounding.

45
States and stimuli for the microwave oven (b)

Stimulus Description
Half power The user has pressed the half-power button.

Full power The user has pressed the full-power button.

Timer The user has pressed one of the timer buttons.

Number The user has pressed a numeric key.

Door open The oven door switch is not closed.

Door closed The oven door switch is closed.

Start The user has pressed the Start button.

Cancel The user has pressed the Cancel button.

46
Figure 5.18. A state model of the Operation state

47
Model-driven engineering

• Model-driven engineering (MDE) is an approach to software development where


models rather than programs are the principal outputs of the development process.

• The programs that execute on a hardware/software platform are then generated


automatically from the models.
• Model-driven engineering was developed from the idea of model-driven
architecture (MDA). This was proposed by the Object Management Group (OMG)
as a new software development paradigm (Mellor, Scott, and Weise 2004).
• MDA focuses on the design and implementation stages of software development,
whereas MDE is concerned with all aspects of the software engineering process.

48
Usage of model-driven engineering

• Model-driven engineering is still at an early stage of development, and it is unclear


whether or not it will have a significant effect on software engineering practice.

• Pros
• Allows systems to be considered at higher levels of abstraction
• Generating code automatically means that it is cheaper to adapt systems to new
platforms.

• Cons
• Models for abstraction and not necessarily right for implementation.
• Savings from generating code may be outweighed by the costs of developing
translators for new platforms.

49
Model driven architecture

• Model-driven architecture is a model-focused approach to software design


and implementation that uses a subset of UML models to describe a
system. or
• Model-driven architecture is a software design approach for the
development of software systems. It provides a set of guidelines for the
structuring of specifications, which are expressed as models.
• Models at different levels of abstraction are created.

• From a high-level, platform independent model, it is possible, in principle,


to generate a working program without manual intervention.

50
Types of model
Computation independent model (CIM)
•These model the important domain abstractions used in a system
•Also called domain model / business model
Platform independent model (PIM)
•Model the operation / functionality of the system without implementation
•The PIM is usually described using UML models that show the static system
structure and how it responds to external and internal events.
•Also called design model
Platform specific models (PSM)
•Implementation model.
•These are transformations of the platform-independent model with a separate
PSM for each application platform.
•Each layer adding some platform-specific detail. 51
Figure 5.19. MDA transformations

52
Figure 5.20. Multiple model platform-specific models

53
Solve the following questions
Q. Develop a sequence diagram showing the interactions involved when a student registers for a course in a
university. Courses may have limited enrollment, so the registration process must include checks that places are
available. Assume that the student accesses an electronic course catalog to find out about available courses
Q. Draw a UML class diagram to capture the following situation: “Every student is enrolled in a course. Each
student may be enrolled in a set of units. Some units are core units for one or more courses and some units are
elective units for one or more courses.”
Q. Based on your experience with a bank ATM, draw an activity diagram that models the data processing
involved when a customer withdraws cash from the machine
Q. Draw a sequence diagram for the same system. Explain why you might want to develop both activity and
sequence diagrams when modeling the behavior of a system.
Q. Represent the following relations among classes using UML diagram.
1.Students credit 5 courses each semester. Each course is taught by one or more teachers.
2.Bill contains number of items. Each item describes some commodity, the price of unit, and total on this price.
3.An order consists of one or more order items. Each order item contains the name of the item, its quantity and
the date by which it is required. Each order item is described by an item type specification object having details
such as its vendor addresses, its unit price, and the manufacturer.

54
Thank you

55

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy