Unit 2 - Software Architecture
Unit 2 - Software Architecture
Figure 2.1 (a): Structural Modelling Core Elements Figure 2.1 (b): Structural Modelling Core Relationships
Framework Models: An architecture framework is an encapsulation of a minimum set of practices and
requirements for artifacts that describe a system's architecture. Models are representations of how objects fit
in system and behave as part of the system. An architecture framework captures the "conventions, principles
and practices for the description of architectures, established within a specific domain of application and/or
community of stakeholders". A framework is usually implemented in terms of one or more viewpoints. Attempts
to identify repeatable architectural design patterns encountered in similar types of application. This leads to an
increase in the level of abstraction.
Dynamic Models: The dynamic model is used to express and model the behavior of the system over time. It
includes support for activity diagrams, state diagrams, sequence diagrams and extensions including business
process modelling. After the static behavior of the system is analyzed, its behavior with respect to time and
external changes needs to be examined. This is the purpose of dynamic modeling.
Dynamic Modeling can be defined as “a way of describing how an individual object responds to events, either
internal events triggered by other objects, or external events triggered by the outside world.”
The process of dynamic modeling can be visualized in the following steps −
• Identify states of each object.
• Identify events and analyze the applicability of actions.
• Construct a dynamic model diagram, comprising of state transition diagrams.
• Express each state in terms of object attributes.
• Validate the state–transition diagrams drawn.
Dynamic model is represented graphically with the help of state diagrams. It is also known as state modelling.
State model consist of multiple state diagrams, one for each class with temporal behavior that is important to
an application. State diagram relates with events and states. Events represents external functional activity and
states represents values objects.
Events: An event is something that happen at a point in particular time such as a person press button or train
12345 departs from Indore. Event conveys information from one object to another.
The events are of three types: Signal event, Change event, and Time event.
Signal Event: A signal event is a particular occurrence in time. A signal is an explicit one-way transmission of
information from one object to another such as sending or receiving signal. When an object send signal to
another object it waits for acknowledgement, but acknowledgement signal is the separate signal under the
control of second object, which may or may not choose to send it.
Change Event: It is caused by the satisfaction of a boolean expression. The intent of the change event is that the
expression is tested continually whenever the expression changes from false to true.
Example: when (battery power < lower limit)
When (room temperature < heating/cooling point)
Time event: It is caused by occurrence of an absolute or the elapse of time interval. The UML notation for
absolute time is the keyword when followed by a parenthesized expression involving time and for the time
interval is keyword after followed by a parenthesized expression that evaluates time duration.
Example: when (Date = mar 2, 2005)
after (50 seconds)
State: A state is an abstraction of attribute values and links of an object. Values and links are combined into a
state according to their entire behaviour. The response of object according to input event is called state. A state
corresponds to the interval between two events received by an object. The state of the event depends on the
past event. So basically, state represents intervals of time. The UML notation for the state is a round box
containing an optional state name list, list the name in boldface, center the name near the top of the box,
capitalize the first letter.
The above diagram shows the flow of batch sequential architecture. It provides simpler divisions on subsystems
and each subsystem can be an independent program working on input data and produces output data.
Advantages
• Provides simpler divisions on subsystems.
• Each subsystem can be an independent program working on input data and producing output data.
Disadvantages
• Provides high latency and low throughput.
• Does not provide concurrency and interactive interface.
• External control is required for implementation.
2. Pipe and Filter Architecture:
This approach lays emphasis on the incremental transformation of data by successive component. In this
approach, the flow of data is driven by data and the whole system is decomposed into components of data
source, filters, pipes, and data sinks. The connections between modules are data stream which is first-in/first-
out buffer that can be stream of bytes, characters, or any other type of such kind. The main feature of this
architecture is its concurrent and incremented execution.
Pipe represents-
• Pipe is a connector which passes the data from one filter to the next.
• Pipe is a directional stream of data implemented by a data buffer to store all data, until the next filter
has time to process it.
• It transfers the data from one data source to one data sink.
• Pipes are the stateless data stream.
Filter represents-
• A filter is a component and an independent entity or independent data stream transformer or stream
transducers.
• It transforms and refines input data or input data stream, processes it, and writes the transformed data
stream over a pipe for the next filter to process.
• It works in an incremental mode, in which it starts working as soon as data arrives through connected
pipe.
• It has interfaces from which a set of inputs can flow in and a set of outputs can flow out.
There are two types of filters − active filter and
passive filter.
Active filter: Active filter lets connected pipes to pull
data in and push out the transformed data. It
operates with passive pipe, which provides
read/write mechanisms for pulling and pushing. This
mode is used in UNIX pipe and filter mechanism.
Passive filter: Passive filter lets connected pipes to
push data in and pull data out. It operates with active
pipe, which pulls data from a filter and pushes data
into the next filter. It must provide read/write
Figure 2.5: Pipes and Filter mechanism.
All filters are the processes that run at the same time, it means that they can run as different threads, coroutines
or be located on different machines entirely. Each pipe is connected to a filter and has its own role in the function
of the filter. The filters are robust where pipes can be added and removed at runtime. Filter reads the data from
its input pipes and performs its function on this data and places the result on all output pipes. If there is
insufficient data in the input pipes, the filter simply waits.
Advantages:
• Provides concurrency and high throughput for excessive data processing.
• Provides reusability and simplifies system maintenance.
• Provides modifiability and low coupling between filters.
• Provides flexibility by supporting both sequential and parallel execution.
Disadvantages:
• Not suitable for dynamic interactions.
• Overhead of data transformation between filters.
• Does not provide a way for filters to cooperatively interact to solve a problem.
• Difficult to configure this architecture dynamically.
3. Process Control: Process Control Architecture is a type of Data Flow Architecture, where data is neither
batch sequential nor pipe stream. In process control architecture, the flow of data comes from a set of variables
which controls the execution of process.
This architecture decomposes the entire system into subsystems or modules and connects them. Types of
Subsystems- A process control architecture would have a processing unit for changing the process control
variables and a controller unit for calculating the amount of changes.
A controller unit must have the following elements −
• Controlled Variable − Controlled Variable provides values for the underlying system and should be
measured by sensors. For example, speed in cruise control system.
• Input Variable − Measures an input to the process. For example, temperature of return air in
temperature control system
• Manipulated Variable − Manipulated Variable value is adjusted or changed by the controller.
• Process Definition − It includes mechanisms for manipulating some process variables.
• Sensor − Obtains values of process variables pertinent to control and can be used as a feedback
reference to recalculate manipulated variables.
• Set Point − It is the desired value for a controlled variable.
• Control Algorithm − It is used for deciding how to manipulate process variables.
Application Areas:
Process control architecture is suitable in the following domains −
• Embedded system software design, where the system is manipulated by process control variable data.
• Applications, which aim is to maintain specified properties of the outputs of the process at given
reference values.
• Applicable for car-cruise control and building temperature control systems.
• Real-time system software to control automobile anti-lock brakes, nuclear power plants, etc.
Call-and Return Architecture: A call and return architecture enables software designers to achieve a program
structure, which can be easily modified. This style consists of the following two substyles.
1. Main program/subprogram architecture: In this, function is decomposed into a control hierarchy where
the main program invokes a number of program components, which in turn may invoke other
components.
2. Remote procedure call architecture: In this, components of the main or subprogram architecture are
distributed over a network across multiple computers.
Call and Return (Functional):
• Routines correspond to units of the task to be performed.
• Combined through control structures.
• Routines known through interfaces (argument list)
Advantages: Disadvantages:
• Architecture based on well-identified parts of the task. • Must know which exact routine to
• Change implementation of routine without affecting change.
clients. • Hides role of data structure.
• Reuse of individual operations. • Bad support for extendibility.
Call and Return (Object-Oriented):
• A class describes a type of resource and all accesses to it (encapsulation).
• Representation hidden from client classes.
Advantages: Disadvantages:
• Change implementation without affecting • Objects must know their interaction partners;
clients. when partner changes, clients must change.
• Can break problems into interacting agents. • Side effects: if A uses B and C uses B, then C’s
• Can distribute across multiple machines or effects on B can be unexpected to A.
networks.
Data-Centered Architecture: Data Centered Architecture is also known as Database Centric Architecture.
It is a layered process which provides architectural guidelines in data center development. This architecture is
the physical and logical layout of the resources and equipment within a data center facility.
• In data-centred architecture, the data is centralized and accessed frequently by other components,
which modify data.
• It consists of different components that communicate through shared data repositories.
• The components access a shared data structure and are relatively independent, in that, they interact
only through the data store.
• This architecture specifies how these devices will be interconnected and how physical and logical
security workflows are arranged.