Unit 4:ARCHITECTURE DESIGN AND IMPLIMENTATION
Reference: Sommerville, Software Engineering.
Architectural design is a process for identifying the sub-systems making up a system and the framework for
sub-system control and communication. The output of this design process is a description of the software
architecture. Architectural design is an early stage of the system design process. It represents the link between
specification and design processes and is often carried out in parallel with some specification activities. It
involves identifying major system components and their communications.
Software architectures can be designed at two levels of abstraction:
Architecture in the small is concerned with the architecture of individual programs. At this
level, we are concerned with the way that an individual program is decomposed into components.
Architecture in the large is concerned with the architecture of complex enterprise systems that
include other systems, programs, and program components. These enterprise systems are
distributed over different computers, which may be owned and managed by different companies.
Figure 4.1 The architecture of a packing robot control system
Three advantages of explicitly designing and documenting software architecture:
Stakeholder communication: Architecture may be used as a focus of discussion by system
stakeholders.
System analysis: Well-documented architecture enables the analysis of whether the system can
meet its non-functional requirements.
Vinutha H M S M D C [cs dept]
Large-scale reuse: The architecture may be reusable across a range of systems or entire lines
of products.
Software architecture is most often represented using simple, informal block diagrams showing entities and
relationships. Pros: simple, useful for communication with stakeholders, great for project planning. Cons: lack
of semantics, types of relationships between entities, visible properties of entities in the architecture.
Uses of architectural models:
As a way of facilitating discussion about the system design
A high-level architectural view of a system is useful for communication with system stakeholders and
project planning because it is not cluttered with detail. Stakeholders can relate to it and understand an
abstract view of the system. They can then discuss the system as a whole without being confused by
detail.
As a way of documenting an architecture that has been designed
The aim here is to produce a complete system model that shows the different components in a
system, their interfaces and their connections.
Architectural design decisions
Architectural design is a creative process so the process differs depending on the type of system being
developed. However, a number of common decisions span all design processes and these decisions affect
the non-functional characteristics of the system:
Is there a generic application architecture that can be used?
How will the system be distributed?
What architectural styles are appropriate?
What approach will be used to structure the system?
How will the system be decomposed into modules?
What control strategy should be used?
How will the architectural design be evaluated?
How should the architecture be documented?
Systems in the same domain often have similar architectures that reflect domain concepts. Application
product lines are built around a core architecture with variants that satisfy particular customer requirements.
The architecture of a system may be designed around one of more architectural patterns/styles, which
capture the essence of an architecture and can be instantiated in different ways.
The particular architectural style should depend on the non-functional system requirements:
Performance: localize critical operations and minimize communications. Use large rather than
fine-grain components.
Security: use a layered architecture with critical assets in the inner layers.
Safety: localize safety-critical features in a small number of sub-systems.
Availability: include redundant components and mechanisms for fault tolerance.
Maintainability: use fine-grain, replaceable components.
Architectural views
Each architectural model only shows one view or perspective of the system. It might show how a system is
decomposed into modules, how the run-time processes interact or the different ways in which system
components are distributed across a network. For both design and documentation, you usually need to present
multiple views of the software architecture.
4+1 view model of software architecture:
Vinutha H M S M D C [cs dept]
A logical view, which shows the key abstractions in the system as objects or object classes.
A process view, which shows how, at run-time, the system is composed of interacting processes.
A development view, which shows how the software is decomposed for development.
A physical view, which shows the system hardware and how software components are
distributed across the processors in the system.
Related using use cases or scenarios (+1).
Architectural patterns
Patterns are a means of representing, sharing and reusing knowledge. An architectural pattern is a stylized
description of a good design practice, which has been tried and tested in different environments. Patterns
should include information about when they are and when the are not useful. Patterns may be represented
using tabular and graphical descriptions.
Model-View-Controller
Serves as a basis of interaction management in many web-based systems.
Decouples three major interconnected components:
o The model is the central component of the pattern that directly manages the data, logic
and rules of the application. It is the application's dynamic data structure, independent of
the user interface.
o A view can be any output representation of information, such as a chart or a diagram.
Multiple views of the same information are possible.
o The controller accepts input and converts it to commands for the model or view.
Supported by most language frameworks.
Pattern
Model-View-Controller (MVC)
name
Vinutha H M S M D C [cs dept]
Separates presentation and interaction from the system data. The system is structured into
three logical components that interact with each other. The Model component manages the
system data and associated operations on that data. The View component defines and
Description
manages how the data is presented to the user. The Controller component manages user
interaction (e.g., key presses, mouse clicks, etc.) and passes these interactions to the View
and the Model.
The display presented to the user frequently changes over time in response to input or
Problem computation. Different users have different needs for how they want to view the program.s
description information. The system needs to reflect data changes to all users in the way that they want
to view them, while making it easy to make changes to the user interface.
This involves separating the data being manipulated from the manipulation logic and the
Solution details of display using three components: Model (a problem-domain component with data
description and operations, independent of the user interface), View (a data display component), and
Controller (a component that receives and acts on user input).
Advantages: views and controllers can be easily be added, removed, or changed; views can
be added or changed during execution; user interface components can be changed, even at
Consequences runtime. Disadvantages: views and controller are often hard to separate; frequent updates
may slow data display and degrade user interface performance; the MVC style makes user
interface components (views, controllers) highly dependent on model components.
Layered architecture
Used to model the interfacing of sub-systems.
Organizes the system into a set of layers (or abstract machines) each of which provide a set of
services.
Supports the incremental development of sub-systems in different layers. When a layer interface
changes, only the adjacent layer is affected.
However, often artificial to structure systems in this way.
Vinutha H M S M D C [cs dept]
Name Layered architecture
Organizes the system into layers with related functionality associated with each layer. A layer
Description provides services to the layer above it so the lowest-level layers represent core services that
are likely to be used throughout the system.
Used when building new facilities on top of existing systems; when the development is spread
When used across several teams with each team responsibility for a layer of functionality; when there is a
requirement for multi-level security.
Allows replacement of entire layers so long as the interface is maintained. Redundant facilities
Advantages (e.g., authentication) can be provided in each layer to increase the dependability of the
system.
In practice, providing a clean separation between layers is often difficult and a high-level layer
may have to interact directly with lower-level layers rather than through the layer immediately
Disadvantages
below it. Performance can be a problem because of multiple levels of interpretation of a service
request as it is processed at each layer.
Repository architecture
Sub-systems must exchange data. This may be done in two ways:
o Shared data is held in a central database or repository and may be accessed by all sub-
systems;
o Each sub-system maintains its own database and passes data explicitly to other sub-
systems.
When large amounts of data are to be shared, the repository model of sharing is most commonly
used a this is an efficient data sharing mechanism.
Name Repository
Vinutha H M S M D C [cs dept]
All data in a system is managed in a central repository that is accessible to all system
Description
components. Components do not interact directly, only through the repository.
You should use this pattern when you have a system in which large volumes of information are
When used generated that has to be stored for a long time. You may also use it in data-driven systems
where the inclusion of data in the repository triggers an action or tool.
Components can be independent--they do not need to know of the existence of other
Advantages components. Changes made by one component can be propagated to all components. All data
can be managed consistently (e.g., backups done at the same time) as it is all in one place.
The repository is a single point of failure so problems in the repository affect the whole
Disadvantages system. May be inefficiencies in organizing all communication through the repository.
Distributing the repository across several computers may be difficult.
Client-server architecture
Distributed system model which shows how data and processing is distributed across a range of
components, but can also be implemented on a single computer.
Set of stand-alone servers which provide specific services such as printing, data management,
etc.
Set of clients which call on these services.
Network which allows clients to access servers.
Name Client-server
Vinutha H M S M D C [cs dept]
In a client-server architecture, the functionality of the system is organized into services, with
Description each service delivered from a separate server. Clients are users of these services and access
servers to make use of them.
Used when data in a shared database has to be accessed from a range of locations. Because
When used
servers can be replicated, may also be used when the load on a system is variable.
The principal advantage of this model is that servers can be distributed across a network.
Advantages General functionality (e.g., a printing service) can be available to all clients and does not need
to be implemented by all services.
Each service is a single point of failure so susceptible to denial of service attacks or server
Disadvantages failure. Performance may be unpredictable because it depends on the network as well as the
system. May be management problems if servers are owned by different organizations.
Pipe and filter architecture
Functional transformations process their inputs to produce outputs.
May be referred to as a pipe and filter model (as in UNIX shell).
Variants of this approach are very common. When transformations are sequential, this is a batch
sequential model which is extensively used in data processing systems.
Not really suitable for interactive systems.
Name Pipe and filter
The processing of the data in a system is organized so that each processing component (filter)
Description is discrete and carries out one type of data transformation. The data flows (as in a pipe) from
one component to another for processing.
Commonly used in data processing applications (both batch- and transaction-based) where
When used
inputs are processed in separate stages to generate related outputs.
Vinutha H M S M D C [cs dept]
Easy to understand and supports transformation reuse. Workflow style matches the structure
Advantages of many business processes. Evolution by adding transformations is straightforward. Can be
implemented as either a sequential or concurrent system.
The format for data transfer has to be agreed upon between communicating transformations.
Each transformation must parse its input and unparse its output to the agreed form. This
Disadvantages
increases system overhead and may mean that it is impossible to reuse functional
transformations that use incompatible data structures.
Application architectures
Application systems are designed to meet an organizational need. As businesses have much in common, their
application systems also tend to have a common architecture that reflects the application requirements.
A generic application architecture is an architecture for a type of software system that may be configured
and adapted to create a system that meets specific requirements. application architectures can be used as a:
Starting point for architectural design.
Design checklist.
Way of organizing the work of the development team.
Means of assessing components for reuse.
Vocabulary for talking about application types.
Examples of application types:
Data processing applications
Data driven applications that process data in batches without explicit user intervention during the
processing.
Transaction processing applications
Data-centred applications that process user requests and update information in a system database.
Event processing systems
Applications where system actions depend on interpreting events from the system's environment.
Language processing systems
Applications where the users' intentions are specified in a formal language that is processed and
interpreted by the system.
Software design and implementation is the stage in the software engineering process at which an executable
software system is developed. Software design is a creative activity in which you identify software
components and their relationships, based on a customer's requirements. Implementation is the process of
realizing the design as a program. These two activities are invariably inter-leaved.
In a wide range of domains, it is now possible to buy commercial off-the-shelf systems (COTS) that can
be adapted and tailored to the users' requirements. When you develop an application in this way, the design
process becomes concerned with how to use the configuration features of that system to deliver the system
requirements.
Object-oriented design using the UML
Structured object-oriented design processes involve developing a number of different system models. They
require a lot of effort for development and maintenance and, for small systems, this may not be cost-effective.
However, for large systems developed by different groups design models are an important communication
mechanism. Common activities in these processes include:
Vinutha H M S M D C [cs dept]
Define the context and modes of use of the system;
Design the system architecture;
Identify the principal system objects;
Develop design models;
Specify object interfaces.
System context and interactions
Understanding the relationships between the software that is being designed and its external
environment is essential for deciding how to provide the required system functionality and how to structure
the system to communicate with its environment. Understanding of the context also lets you establish
the boundaries of the system. Setting the system boundaries helps you decide what features are
implemented in the system being designed and what features are in other associated systems.
A system context is a structural model (e.g., a class diagram) that demonstrates the other systems in the
environment of the system being developed.
An interaction model is a dynamic model (e.g., a use case diagram + structured natural language
description) that shows how the system interacts with its environment as it is used.
Vinutha H M S M D C [cs dept]
System Weather station
Vinutha H M S M D C [cs dept]
Use case Report weather
Actors Weather information system, Weather station
The weather station sends a summary of the weather data that has been collected from the
instruments in the collection period to the weather information system. The data sent are the
Description maximum, minimum, and average ground and air temperatures; the maximum, minimum, and
average air pressures; the maximum, minimum, and average wind speeds; the total rainfall; and
the wind direction as sampled at five-minute intervals.
The weather information system establishes a satellite communication link with the weather
Stimulus
station and requests transmission of the data.
Response The summarized data is sent to the weather information system.
Weather stations are usually asked to report once per hour but this frequency may differ from one
Comments
station to another and may be modified in the future.
Architectural design
Once interactions between the system and its environment have been understood, you use this information for
designing the system architecture. You identify the major components that make up the system and their
interactions, and then may organize the components using an architectural pattern (e.g. a layered or client-
server model).
Identifying object classes is often a difficult part of object oriented design. There is no 'magic formula' for
object identification. It relies on the skill, experience
and domain knowledge of system designers. Object identification is an iterative process. You are unlikely to get
it right first time. Approaches to object identification include:
Use a grammatical approach based on a natural language description of the system.
Base the identification on tangible things in the application domain.
Use a behavioral approach and identify objects based on what participates in what behavior.
Use a scenario-based analysis. The objects, attributes and methods in each scenario are
identified.
Vinutha H M S M D C [cs dept]
Design models
Design models show the objects and object classes and relationships between these entities. Static
models describe the static structure of the system in terms of object classes and relationships. Dynamic
models describe the dynamic interactions between objects.
Subsystem models show logical groupings of objects into coherent subsystems. These are represented using
a form of class diagram with each subsystem shown as a package with enclosed objects. Subsystem models
are static (structural) models.
Sequence models show the sequence of object interactions. These are represented using a UML sequence or
a collaboration diagram. Sequence models are dynamic models.
State machine models show how individual objects change their state in response to events. These are
represented in the UML using state diagrams. State machine models are dynamic models. State diagrams are
useful high-level models of a system or an object's run-time behavior.
Vinutha H M S M D C [cs dept]
Interface specification
Object interfaces have to be specified so that the objects and other components can be designed in
parallel. Designers should avoid designing the interface representation but should hide this in the object itself.
Objects may have several interfaces which are viewpoints on the methods provided. The UML uses class
diagrams for interface specification but Java may also be used.
Design patterns
A design pattern is a way of reusing abstract knowledge about a problem and its solution. A pattern is a
description of the problem and the essence of its solution. It should be sufficiently abstract to be reused in
different settings. Pattern descriptions usually make use of object-oriented characteristics such as inheritance
and polymorphism.
Design pattern elements:
Name
A meaningful pattern identifier
Problem description
A common situation where this pattern is applicable
Solution description
Not a concrete design but a template for a design solution that can be instantiated in different ways
Vinutha H M S M D C [cs dept]
Consequences
The results and trade-offs of applying the pattern
Example: the Observer pattern
Pattern
Observer
name
Separates the display of the state of an object from the object itself and allows alternative
Description displays to be provided. When the object state changes, all displays are automatically notified
and updated to reflect the change.
In many situations, you have to provide multiple displays of state information, such as a
graphical display and a tabular display. Not all of these may be known when the information
is specified. All alternative presentations should support interaction and, when the state is
Problem
changed, all displays must be updated.
description
This pattern may be used in all situations where more than one display format for state
information is required and where it is not necessary for the object that maintains the state
information to know about the specific display formats used.
This involves two abstract objects, Subject and Observer, and two concrete objects,
ConcreteSubject and ConcreteObject, which inherit the attributes of the related abstract
objects. The abstract objects include general operations that are applicable in all situations.
The state to be displayed is maintained in ConcreteSubject, which inherits operations from
Solution Subject allowing it to add and remove Observers (each observer corresponds to a display)
description and to issue a notification when the state has changed.
The ConcreteObserver maintains a copy of the state of ConcreteSubject and implements the
Update() interface of Observer that allows these copies to be kept in step. The
ConcreteObserver automatically displays the state and reflects changes whenever the state is
updated.
The subject only knows the abstract Observer and does not know details of the concrete
Consequences class. Therefore there is minimal coupling between these objects. Because of this lack of
knowledge, optimizations that enhance display performance are impractical. Changes to the
Vinutha H M S M D C [cs dept]
subject may cause a set of linked updates to observers to be generated, some of which may
not be necessary.
Reuse
From the 1960s to the 1990s, most new software was developed from scratch, by writing all code in a high-
level programming language. The only significant reuse or software was the reuse of functions and objects in
programming language libraries. Costs and schedule pressure mean that this approach became increasingly
unviable, especially for commercial and Internet-based systems. An approach to development based around
the reuse of existing software emerged and is now generally used for business and scientific software.
Levels of reuse:
The abstraction level: don't reuse software directly but use knowledge of successful abstractions
in the software design.
The object level: directly reuse objects from a library rather than writing the code yourself.
The component level: components (collections of objects and object classes) are reused in
application systems.
The system level: entire application systems are reused.
Costs of reuse:
The costs of the time spent in looking for software to reuse and assessing whether or not it
meets your needs.
Where applicable, the costs of buying the reusable software. For large off-the-shelf systems,
these costs can be very high.
The costs of adapting and configuring the reusable software components or systems to reflect
the requirements of the system that you are developing.
The costs of integrating reusable software elements with each other (if you are using software
from different sources) and with the new code that you have developed.
Implementation issues
Focus here is not on programming, although this is obviously important, but on other
implementation issues that are often not covered in programming texts: –
Reuse Most modern software is constructed by reusing existing components or systems.
When you are developing software, you should make as much use as possible of existing
code. –
Configuration management During the development process, you have to keep track of the
many different versions of each software component in a configuration management
system. – Host-target development Production software does not usually execute on the
same computer as the software development environment. Rather, you develop it on one
computer (the host system) and execute it on a separate computer (the target system).
Vinutha H M S M D C [cs dept]