Professional Documents
Culture Documents
System Modeling
System Modeling: System modelling is the process of developing
abstract models of a system.
It also provides the developer and the customer with the means to assess
quality, once the software is built.
System Perspectives:
An context/external perspective :
model the context or environment of the system.
An interaction perspective :
model the interactions between a system and its environment, or between the
components of a system.
A structural perspective :
model the organization of a system or the structure of the data that is processed
by the system.
A behavioral perspective :
model the dynamic behavior of the system and how it responds to events.
UML diagram types :
Class Diagram:
Class diagrams are the most common diagrams used in UML. Class diagram
consists of classes, interfaces, associations, and collaboration. Class diagrams
basically represent the object-oriented view of a system, which is static in
nature.
Active class is used in a class diagram to represent the concurrency of the
system.
Class diagram represents the object orientation of a system. Hence, it is
generally used for development purpose. This is the most widely used diagram
at the time of system construction.
Object diagrams :
It can be described as an instance of class diagram. Thus, these diagrams are
more close to real-life scenarios where we implement a system.
Object diagrams are a set of objects and their relationship is just like class
diagrams. They also represent the static view of the system.
The usage of object diagrams is similar to class diagrams but they are used to
build prototype of a system from a practical perspective.
Use case diagrams :
A set of use cases, actors, and their relationships. They represent the use case
view of a system.
A use case represents a particular functionality of a system. Hence, use case
diagram is used to describe the relationships among the functionalities and their
internal/external controllers. These controllers are known as actors.
Sequence diagram:
is an interaction diagram. From the name, it is clear that the diagram deals with
some sequences, which are the sequence of messages flowing from one object
to another.
Interaction among the components of a system is very important from
implementation and execution perspective. Sequence diagram is used to
visualize the sequence of calls in a system to perform a specific functionality.
The UML diagrams are categorized into structural diagrams, behavioral
diagrams, and also interaction overview diagrams. The diagrams are
hierarchically classified in the following figure:
1. Structural Diagrams:
Structural diagrams depict a static view or structure of a system. It is widely
used in the documentation of software architecture. It embraces class diagrams,
composite structure diagrams, component diagrams, deployment diagrams,
object diagrams, and package diagrams. It presents an outline for the system. It
stresses the elements to be present that are to be modeled.
o Class Diagram: Class diagrams are one of the most widely used
diagrams. It is the backbone of all the object-oriented software systems. It
depicts the static structure of the system. It displays the system's class,
attributes, and methods. It is helpful in recognizing the relation between
different objects as well as classes.
o Composite Structure Diagram: The composite structure diagrams show
parts within the class. It displays the relationship between the parts and
their configuration that ascertain the behavior of the class. It makes full
use of ports, parts, and connectors to portray the internal structure of a
structured classifier. It is similar to class diagrams, just the fact it
represents individual parts in a detailed manner when compared with
class diagrams.
o Object Diagram: It describes the static structure of a system at a
particular point in time. It can be used to test the accuracy of class
diagrams. It represents distinct instances of classes and the relationship
between them at a time.
o Component Diagram: It portrays the organization of the physical
components within the system. It is used for modeling execution details.
It determines whether the desired functional requirements have been
considered by the planned development or not, as it depicts the structural
relationships between the elements of a software system.
o Deployment Diagram: It presents the system's software and its hardware
by telling what the existing physical components are and what software
components are running on them. It produces information about system
software. It is incorporated whenever software is used, distributed, or
deployed across multiple machines with dissimilar configurations.
o Package Diagram: It is used to illustrate how the packages and their
elements are organized. It shows the dependencies between distinct
packages. It manages UML diagrams by making it easily understandable.
It is used for organizing the class and use case diagrams.
2. Behavioral Diagrams:
Behavioral diagrams portray a dynamic view of a system or the behavior of a
system, which describes the functioning of the system. It includes use case
diagrams, state diagrams, and activity diagrams. It defines the interaction within
the system
Interaction Model:
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.
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.
Sommerville covers two related (complementary) approaches to
interaction modeling:
1. Use case modeling, which is mostly used to model interactions
between a system and external actors (users or other systems).
2. Sequence diagrams, which are used to model interactions between
system components, although external agents may also be included.
o 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.
Represented diagramatically to provide an overview of the use case
and in a more detailed textual form. A Use Case Model describes the
proposed functionality of a new system.
A Use Case represents a discrete unit of interaction between a user
(human or machine) and the system.
This interaction is a single unit of meaningful work, such as Create
Account or View Account Details.
Each Use Case describes the functionality to be built in the proposed
system, which can include another Use Case's functionality or extend
another Use Case with its own behavior.
Fig 1: Use cases describing interactions to Bank and Shipping system
(external systems).
Fig 2: Use cases describing interactions to Accounting system (external
systems).
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.
1. Class diagram :
Class diagram is a static diagram. It represents the static view of an application.
Class diagram is not only used for visualizing, describing, and documenting
different aspects of a system but also for constructing executable code of the
software application.
Class diagram describes the attributes and operations of a class and also the
constraints imposed on the system.
The class diagrams are widely used in the modeling of objectoriented systems
because they are the only UML diagrams, which can be mapped directly with
object-oriented languages.
Class diagram shows a collection of classes, interfaces, associations,
collaborations, and constraints. It is also known as a structural diagram.
Purpose of Class Diagrams
The purpose of class diagram is to model the static view of an
application.
Class diagrams are the only diagrams which can be directly mapped with
object-oriented languages and thus widely used at the time of
construction.
UML diagrams like activity diagram, sequence diagram can only give the
sequence flow of the application, however class diagram is a bit different.
It is the most popular UML diagram in the coder community.
The purpose of the class diagram can be summarized as –
Analysis and design of the static view of an application.
Describe responsibilities of a system.
Base for component and deployment diagrams.
Forward and reverse engineering.
Behavioral models:
Behavioral diagrams portray a dynamic view of a system or the behavior of a
system, which describes the functioning of the system.
It includes use case diagrams, state diagrams, and activity diagrams. It
defines the interaction within the system.
o State Machine Diagram: It is a behavioral diagram. it portrays the
system's behavior utilizing finite state transitions. It is also known as
the State-charts diagram. It models the dynamic behavior of a class in
response to external stimuli.
o Activity Diagram: It models the flow of control from one activity to the
other. With the help of an activity diagram, we can model sequential and
concurrent activities. It visually depicts the workflow as well as what
causes an event to occur.
o Use Case Diagram: It represents the functionality of a system by
utilizing actors and use cases. It encapsulates the functional requirement
of a system and its association with actors. It portrays the use case view
of a system.
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.
You can think of these stimuli as being of two 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 associated data but this is not always the case.
Data-driven modelling:
Data-driven models show the sequence of actions involved in processing
input data and generating the associated output.
This is very useful during the analysis stage since they show end-to-end
processing in a system which means that they show the entire action
sequence of how input data become output data.
In ither words, it shows the response of the system to particular input.
Data Driven Modeling (DDM) is a technique using which the configurator
model components are dynamically injected into the model based on the data
derived from external systems such as catalog system, Customer
Relationship Management (CRM), Watson, and so on.
The basic processes of the online store (starting from the insertion of a new
product through browsing and selecting products to buy till tracking the
order's delivery and provide feedback) is shown on the following activity
diagram.
Event-driven modelling:
The event driven modeling is a programming technique in which system
response to external and internal events such as user actions, mouse
clicks, key pressing, message from other threads on the based of an
events the flow of the program is determined.
The event driven modeling technique is based on the thinks that the
system has a finite state and event is a reason of moving from one state to
another state. The graphical user interfaces and other applications (e.g.
java script, web application) use event driven programming techniques to
performing certain type of action in response to a user action.
Event-driven modeling shows how a system responds to external and
internal events (stimuli). It is based on the assumption that a system has a
finite number of states and that an event (stimulus) may cause a transition
from one state to another.
The UML supports event-based modeling using state machine diagrams
State machine diagrams
A state machine diagram models the behaviour of a single object, specifying
the sequence of events that an object goes through during its lifetime in
response to events. It contains the following elements:
State. A state is denoted by a round-cornered rectangle with the
name of the state written inside it. There are two special states:
o Initial state. The initial state is denoted by a filled
black circle and may be labeled with a name.
o Final state. The final state is denoted by a circle
with a dot inside and may also be labeled with a
name.
Transitions. Transitions from one state to the next are denoted
by lines with arrowheads. A transition may have a trigger, a
guard and an effect, as below. Trigger is the cause of the
transition, which could be a signal, an event, a change in some
condition, or the passage of time. Guard is a condition which
must be true in order for the trigger to cause the
transition. Effect is an action which will be invoked directly on
the object that owns the state machine as a result of the
transition.
State action. State actions describe effects associated with a
state. A state action is an activity label/behavior expression
pair. The activity label identifies the circumstances under which
the behavior will be invoked. There are three reserved activity
labels:
o entry: the behavior is performed upon entry to the
state,
o do: ongoing behavior, performed as long as the
element is in the state,
o exit: a behavior that is performed upon exit from
the state.
Self-transition. A state can have a transition that returns to
itself. This is most useful when an effect is associated with the
transition.
Entry point. If we do not enter the machine at the normal
initial state, we can have additional entry points.
Exit point. In a similar manner to entry points, it is possible to
have named alternative exit points.
Fig:State machine diagram of the class ShoppingCart
Model-driven architecture:
Model-driven architecture (Kleppe, et al., 2003; Mellor et al., 2004; Stahl and
Voelter, 2006) is a model-focused approach to software design and
implementation that uses a sub-set of UML models to describe a system. Here,
models at different. Model-Driven Architecture (MDA) is a framework for
software development processes that is at the core of the Object Management
Group's (OMG) recommendations:
2.A platform independent model (PIM) that models the operation of the
system without reference to its implementation. The PIM is usually
described using UML models that show the static system structure and how
it responds to exter- nal and internal events.
These are defined using UML class diagrams that include objects,
attributes, and associations.
2. Class models, in which classes are defined, along with their attributes
and operations.
3. State models, in which a state diagram is associated with each class
and is used to describe the lifecycle of the class.
Architectural design:
Architecture design is concerned with understanding how a system
should be organized and designing the overall structure of that system.
In agile processes, it is generally accepted that an early stage of the
development process should be concerned with establishing an overall
system architecture.
Incremental development of architectures is not usually successful. While
refactor- ing components in response to changes is usually relatively easy,
refactoring a sys- tem architecture is likely to be expensive.
1. Architecture in the small is concerned with the architecture of
individual pro- grams.
At this level, we are concerned with the way that an individual
program is decomposed into components.
2. Architecture in the large is concerned with the architecture of
complex enter- prise systems that include other systems, programs,
and program compo- nents.
These enterprise systems are distributed over different computers,
which may be owned and managed by different companies.
Software architecture is important because it affects the
performance, robustness, distributability, and maintainability of a
system (Bosch, 2000).
As Bosch discusses, individual components 41 implement the
functional system requirements.
The non- functional requirements depend on the system
architecture—the way in which these components are organized
and communicate.
In many systems, non-functional requirements are also influenced
by individual components, but there is no doubt that the
architecture of the system is the dominant influence.
This reduces the costs and problems of safety val- idation and
makes it possible to provide related protection systems that can
safely shut down the system in the event of failure.
The stylized pattern description includes the pattern name, a brief description
(with an associated graphical model), and an example of the type of system
where the pattern is used (again, perhaps with a graphical model).
You should also include information about when the pattern should be used
and its advantages and disadvantages.
Graphical models of the architecture associated with the MVC pattern are
shown in following Figures.
These present the architecture from different views— above Figure is a
conceptual view and following Figure shows a possible run-time architecture
when this pattern is used for interaction management in a web-based system.
Layered architecture
Application architectures
There are many types of application system and, in some cases, they may
seem to be very different.