View on GitHub

Notes

reference notes

Introduction

System modeling:

Models are used :

You may develop models of both the existing system and the system to be developed:

A model is an abstraction of the system being studied rather than an alternative representation of that system, a system model is not a complete representation of system. for example:

You may develop different models to represent the system from different perspectives. For example:

  1. An external perspective, where you model the context or environment of the system.
  2. An interaction perspective, where you model the interactions between a system and its environment, or between the components of a system.
  3. A structural perspective, where you model the organization of a system or the structure of the data processed by the system.
  4. A behavioral perspective, where you model the dynamic behavior of the system and how it responds to events.

There are three ways in which graphical models are commonly used:

  1. As a way to stimulate and focus discussion about an existing or proposed system.
  2. As a way of documenting an existing system.
  3. As a detailed system description that can be used to generate a system implementation.

UML diagram types:

  1. Activity diagrams, which show the activities involved in a process or in data processing.
  2. Use case diagrams, which show the interactions between a system and its environment.
  3. Sequence diagrams, which show interactions between actors and the system and between system components.
  4. Class diagrams, which show the object classes in the system and the associations between these classes.
  5. State diagrams, which show how the system reacts to internal and external events.

Context models

used to illustrate the operational context of a system

At an early stage in the specification of a system, you should decide on the system boundaries

System boundaries:

Social and organisational concerns may affect the decision on where to position system boundaries.

Example : The context of the Mentcare system

mc

What is being shown here?

What is not shown here?

Architectural models show the system and its relationship with sother systems.

The lack of context model:

Interaction models

Modeling system-to-system interaction highlights the communication problems that may arise.

Modeling component interaction helps to understand if a proposed system structure is likely to deliver the required system performance and dependability.

Two approaches for interaction modelling: Use case diagrams and sequence diagrams

Use case modeling

Sample use cases Mentcare system Role ‘Medical Receptionist’:

mc

UML Notation for USE CASE MODELLING

mc mc

Actor:

Use Case:

Generalization:

mc

Include Relationship:

mc

Extend Relationship:

mc

STEPS

▪ Identify the actors ▪ For each actor, identify their roles ▪ Identify what are the task required by the actor to perform in order to achieve the goal ▪ Create use case for each goal ▪ Structure the use case

Function transfer data

mc

This is specific use case for “transfer data”. It represents a simple overview of an interaction.

two actors (sticky men):

  1. the operator who is transferring the data
  2. the patient record system.

arrows indicates that the medical receptionist initiates the transaction and data is transferred to the patient record system.

Use case Description

ID: [Unique ID of this use case]
Title: [Enter the goal of the use case - preferably as a short, active verb phrase]
Description: [Describe the goal and context of this use case. This is usually an expanded version of what you entered in the “Title” field.]
Primary Actor: [A person or a software/hardware system that interacts with your system to achieve the goal of this use case.]
Preconditions: [Describe the state the system is in before the first event in this use case.]
Postconditions: [Describe the state the system is in after all the events in this use case have taken place.]
Main Success Scenario: [Describe the flow of events from preconditions to postconditions, when nothing goes wrong. This is the meat of the use case.]
Alternatives scenario: [Describe all the other scenarios for this use case - including exceptions and error cases.]

Example: Use case LOGIN

ID: UC001
Title: Login to the system
Description: A registered user login to the system using username and password that have been created during the user registration process.
Primary Actor: User
Preconditions: User have registered to the system
Postconditions: The system will display a system dashboard
Main Success Scenario: 1. User will click the login link 2. System display the login page 3. User enter the username and password 4. User click the login button 5. System validates with user database 6. System display the user dashboard
Alternatives scenario: 3.1 User enter invalid username or password 3.1.1 System display message “ Wrong username or password” 3.1.2 System executes step no 2 3.2 User enter invalid username and password 3.2.1 System display message “ Wrong username and password” 3.2.2 System executes step no 2

Sequence Diagrams

Sequence diagram for View patient information

mc

watch this video

Use case VIEW PATIENT INFO:

ID: UC03
Title: View Patient Info
Description: This use case displays the patient inform for the view of authorized medical receptionist
Primary Actor: Medical Receptionist
Preconditions: Medical receptionist must login to the system
Postconditions: The system displays the patient info
Main Success Scenario: 1. Medical receptionist clicks the view patient info link 2. The system display the view patient request page 3. Medical receptionist enters the patient ID and click the view button 4. System validates the User ID for the view access 5. System display the patient info
Alternatives scenario: 4.1 Access for view patient info is fail 4.1 The system display the error message “No Access”

Structural models

display the organization of a system in terms of the components that make up that system and their relationships.

Two types:

Created during discussing and designing the system architecture.

Class diagrams

mc

Classes and associations in the Mentcare system:

mc

Semantic Data Models

Extension of object class

mc

Generalization

An everyday technique that we use to manage complexity.

Replace entities in more general classes (animals, cars, houses, etc.) and learn the characteristics of these classes, rather than detailed characteristics of it

Allows different members of classes that have some common characteristics e.g. squirrels and rats are rodents.

Generalization in system models:

A generalization hierarchy:

mc

A generalization hierarchy with added detail:

mc

Aggregation

Shows how classes that are collections are composed of other classes.

Similar to the part-of relationship in semantic data models.

mc

Behavioral models

Models of the dynamic behavior of a system as it is executing. • show what happens or what is supposed to happen when a system responds to a stimulus from its environment. • Two types of stimuli : • Data : Some data arrives that has to be processed by the system. • Events: Some event happens that triggers system processing. Events may have associated data, although this is not always the case. • Types of behavioral modelling: • Data-driven modelling • Event-driven modelling

Models of the dynamic behavior of a system as it is executing.

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

Two types of stimuli :

Types of behavioral modelling:

Data-driven modelling

Event-driven modelling

State diagram of a microwave oven:

mc