Chapter 4: Software Architecture
Chapter 4: Software Architecture
Software architecture is the process of designing the global organization of a software system,
including dividing software into subsystems, deciding how these will interact, and determining
their interfaces.
The architecture is the core of the design, so all software engineers need to understand it.
The architectural model will often constrain the overall efficiency, reusability and
maintainability of the system.
Poor decisions made while creating this model will constrain subsequent design.
Identify the main ways in which the components will interact and the interfaces
between them
Decide how each piece of data and functionality will be distributed among the various
components
Determine if you can re-use an existing framework, if you can build a framework
Consider each use case and adjust the architecture to make it realizable
The Unified Process specifies that the architecture of the system being built, as the
fundamental foundation on which that system will rest,must sit at the heart of project
team’s efforts to shape the system.
Package diagrams
Subsystem diagrams
Component diagrams
Deployment diagrams
Architectural Pattern
Allows you to design flexible systems using components where the components are as
independent of each other as possible.
The most commonly found 4 layers of a general information system are as follows.
Usage:
There is at least one component that has the role of server, waiting for and then
handling connections.
There is at least one component that has the role of client, initiating connections in
order to obtain some service.
A further extension is the Peer-to-Peer pattern.
o A system composed of various software components that are distributed over
several hosts.
Usage
1. Divide and conquer: Dividing the system into client and server processes is a strong way to
divide the system.
3. Reduce coupling: There is usually only one communication channel exchanging simple
messages.
6. Increase reuse: It is often possible to find suitable frameworks on which to build good
distributed systems
7. Design for flexibility: Distributed systems can often be easily reconfigured by adding extra
servers or clients.
9. Design for portability: You can write clients for new platforms without having to port the
server.
10. Design for testability: You can test clients and servers independently.
11. Design defensively: You can put rigorous checks in the message handling code.
This pattern, also known as MVC pattern, divides an interactive application in to 3 parts as,
1. model — contains the core functionality and data, contains the underlying classes
whose instances are to be viewed and manipulated.
2. view — displays the information to the user (more than one view may be defined),
contains objects used to render the appearance of the data from the model in the user
interface.
3. controller — handles the input from the user, contains the objects that control and
handle the user’s interaction with the view and the model.
This is done to separate internal representations of information from the ways information is
presented to, and accepted from, the user. It decouples components and allows efficient code
reuse.
Usage
1. Divide and conquer: The three components can be somewhat independently designed.
2. Increase cohesion: The components have stronger layer cohesion than if the view and
controller were together in a single UI layer.
3. Reduce coupling: The communication channels between the three components are minimal.
6. Increase reuse: The view and controller normally make extensive use of reusable
components for various kinds of UI controls.
7. Design for flexibility: It is usually quite easy to change the UI by changing the view, the
controller, or both.
10. Design for testability: You can test the application separately from the UI.
The View component generates the HTML code to be displayed by the browser.
The Controller is the component that interprets ‘HTTP post’ transmissions coming back
from the browser.
The Model is the underlying system that manages the information.
This architecture is based on the idea that since humans can communicate and collaborate to
accomplish some task by exchanging emails or instant messages, then software applications
should also be able to operate in a similar manner i.e. the different sub-systems communicate
and collaborate to accomplish some task only by exchanging messages.
Senders and receivers need only to know what are the message formats
The self-contained messages are sent by one component (the publisher) through virtual
channels (topics) to which other interested software components can subscribe (subscribers)
The application can choose to ignore a received message or react to it by, for instance, sending
a reply containing requested information. The exchange of these messages is governed by two
important principles. First, message delivery is completely asynchronous; that means the exact
moment at which a given message is delivered to a given subscribing application is unknown.
Secondly, reliability mechanisms are in place such that the messaging system can offer the
guarantee that a given message is delivered once and only once.
Text messaging using cellular phones can be seen as a simple message oriented application, but
more complex systems can also adopt this architecture.
Clearly, the effectiveness of system depends on the messaging system that is used to deliver
the messages. Two approaches can be taken when designing such a system. The first is to use a
centralized architecture where all messages transit through a message server that is
responsible for delivering messages to the subscribers. This is the simpler model, but all
functionality then relies on the server. The alternative is to use a decentralized architecture
where message routing is delegated to the network layer and where some of the server
functionality is distributed among all message clients.