System Models, Design and Implementation
System Models, Design and Implementation
Module 2
Fig 2.2 is a model of an important system process that shows the processes in which
the MHC-PMS is used.
Fig 2.2 is a UML activity diagram.
Activity diagrams are intended to show the activities that make up a system process
and the flow of control from one activity to another.
The start of a process is indicated by a filled circle; the end by a filled circle inside
another circle.
Rectangles with round corners represent activities, that is, the specific sub-processes
that must be carried out.
Objects can be included in activity charts.
In fig 2.2, it can be seen that guards showing the flows for patients who are dangerous
and not dangerous to society.
Patients who are dangerous to society must be detained in a secure facility. However,
patients who are suicidal and so are a danger to themselves may be detained in an
appropriate ward in a hospital.
This more general system maintains summary data about a patient rather than the data
about each consultation, which is recorded in the MHC-PMS.
There are two actors in this use case: the operator who is transferring the data and the
patient record system.
Use case diagrams give a fairly simple overview of an interaction so more details will
have to be added in order to understand what is involved.
This detail can either be a simple textual description, a structured description in a
table, or a sequence diagram.
Fig 2.4 shows a tabular description of the ‘Transfer data’ use case.
Figure 2.5 shows all of the use cases in the MHC-PMS in which the actor ‘Medical
Receptionist’ is involved
A sequence diagram shows the sequence of interactions that take place during a
particular use case or use case instance.
Fig 2.6 is an example of a sequence diagram that illustrates the basics of the notation.
This diagram models the interactions involved in the View patient information use
case, where a medical receptionist can see some patient information.
Fig 2.6 can be read as follows:
1. The medical receptionist triggers the ViewInfo method in an instance P of the
PatientInfo object class, supplying the patient’s identifier, PID. P is a user
interface object, which is displayed as a form showing patient information.
2. The instance P calls the database to return the information required, supplying
the receptionist’s identifier to allow security checking.
3. The database checks with an authorization system that the user is authorized
for this action.
4. If authorized, the patient information is returned and a form on the user’s
screen is filled in. If authorization fails, then an error message is returned.
Fig 2.6:
Sequence
diagram for
View patient
information
Fig
2.7
is a
2. There are two options available. These allow the direct transfer of updated
patient information to the PRS and the transfer of summary health data from
the MHC-PMS to the PRS.
3. In each case, the receptionist’s permissions are checked using the
authorization system.
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.
Fig 2.7:
Sequence
diagram for
transfer data
2.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.
Fig 2.9 develops this type of class diagram to show that objects of class Patient are
also involved in relationships with a number of other classes.
At this level of detail, class diagrams look like semantic data models. Semantic data
models are used in database design.
They show the data entities, their associated attributes, and the relations between these
entities.
When showing the associations between classes, it is convenient to represent these
classes in the simplest possible way.
To define them in more detail, information can be added about their attributes (the
characteristics of an object) and operations .
For example, a Patient object will have the attribute Address and you may include an
operation called ChangeAddress, which is called when a patient indicates that they
have moved from one address to another.
In the UML, attributes and operations can be shown by extending the simple rectangle
that represents a class. This is illustrated in Figure 2.10 where:
1. The name of the object class is in the top section.
2. The class attributes are in the middle section. This must include the attribute
names and, optionally, their types.
3. The operations (called methods in Java and other OO programming languages)
associated with the object class are in the lower section of the rectangle
2.4
Behavioral Models
Behavioral models are models of the dynamic behavior of the 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.
There are 2 types:
1. Data: Some data arrives that has to be processed by the system
2. Events: Some event happens that triggers system processing. Events may have
Prof.Shifana Begum,Dept of CSE,SUCET,MUKKA Page 10
Software Engineering [19SCS44]
Data-flow diagrams (DFD’s) are simple and intuitive and it is usually possible to
explain them to potential system users who can then participate in validating the
model.
Fig 2.14 shows the chain of processing involved in the insulin pump software.
Fig 2.15 illustrates the use of sequence model of the processing of an order and
sending it to a supplier.
Sequence models highlight objects in a system, whereas data-flow diagrams highlight
the functions.
State diagrams show system states and events that cause transitions from one state to
another.
They do not show the flow of data within the system but may include additional
information on the computations carried out in each state.
The sequence of actions in using the microwave is:
1. Select the power level (either half power or full power).
2. Input the cooking time using a numeric keypad.
3. Press Start and the food is cooked for the given time.
From fig 2.16, it can be seen that the system starts in a waiting state and responds
initially to either the full-power or the half-power button.
Users can change their mind after selecting one of these and press the other button.
The time is set and, if the door is closed, the Start button is enabled. Pushing this
button starts the oven operation and cooking takes place for the specified time.
This is the end of the cooking cycle and the system returns to the waiting state.
Figure 2.17, shows a tabular description of each state and how the stimuli that force
state transitions are generated.
The cardinality information on the link shows that there is one control system but
several weather stations, one satellite, and one general weather information system.
The use case model for the weather station is shown in fig 2.24.
This shows that the weather station interacts with the weather information system to
report weather data and the status of the weather station hardware
Fig 2.27 shows the architecture of the data collection subsystem, which is included in
fig 2.26.
The Transmitter and Receiver objects are concerned with managing communications
and the WeatherData object encapsulates the information that is collected from the
instruments and transmitted to the weather information system.
This arrangement follows the producer-consumer pattern
There have been various proposals made about how to identify object classes in object
oriented systems:
* Use a grammatical analysis of a natural language description of the system to
be constructed. Objects and attributes are nouns; operations or services are
verbs.
* Use tangible entities (things) in the application domain such as aircraft, roles
such as manager or doctor, events such as requests, interactions such as
meetings, locations such as offices, organizational units such as companies,
and so on.
* Use a scenario-based analysis where various scenarios of system use are
identified and analyzed in turn.
There are five object classes in fig 2.28.
The Ground thermometer, Anemometer, and Barometer objects are application
domain objects, and the WeatherStation and WeatherData objects have been
identified from the system description and the scenario (use case) description:
* The WeatherStation object class provides the basic interface of the weather
station with its environment.
* The WeatherData object class is responsible for processing the report weather
command. It sends the summarized data from the weather station instruments
to the weather information system.
* The Ground thermometer, Anemometer, and Barometer object classes are
directly related to instruments in the system. They reflect tangible hardware
entities in the system and the operations are concerned with controlling that
hardware. These objects operate autonomously to collect data at the specified
frequency and store the collected data locally. This data is delivered to the
WeatherData object on request.
Design Models
This diagram shows the sequence of interactions that take place when an external system
requests the summarized data from the weather station. Sequence diagrams are read
from top to bottom:
1. The SatComms object receives a request from the weather information system
to collect a weather report from a weather station. It acknowledges receipt of
this request. The stick arrowhead on the sent message indicates that the
external system does not wait for a reply but can carry on with other
processing.
2. SatComms sends a message to WeatherStation, via a satellite link, to create a
summary of the collected weather data. Again, the stick arrowhead indicates
that SatComms does not suspend itself waiting for a reply.
3. WeatherStation sends a message to a Commslink object to summarize the
weather data. In this case, the squared-off style of arrowhead indicates that the
instance of the WeatherStation object class waits for a reply.
4. Commslink calls the summarize method in the object WeatherData and waits
for a reply.
5. The weather data summary is computed and returned to WeatherStation via
diagram.