Architectural Design.
Architectural Design.
Architectural Design
Software Architectural design is concerned with understanding how a system should be
organized and designing the overall structure of that system.
Architectural design organizes a system and defines its structure.
Architectural design is the first stage in the software design process.
This stage connects design with requirements.
It identifies the main parts of the system and their relationships.
The outcome is a model showing how the system's components communicate.
1. 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.
2. 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.
To help you understand what I mean by system architecture, consider Figure 6.1. This shows
an abstract model of the architecture for a packing robot system that shows the
components that have to be developed.
This robotic system can pack different kinds of object.
It uses a vision component to pick out objects on a conveyor, identify the type of object, and
select the right kind of packaging.
The system then moves objects from the delivery conveyor to be packaged.
It places packaged objects on another conveyor.
The architectural model shows these components and the links between them
Architectural Views
Architectural models of a software system can be used to focus discussion about the
software requirements or design.
They may be used to document a design so that it can be used as a basis for more detailed
design and implementation, and for the future evolution of the system.
In this section, Two issues that are relevant to both of these:
1. What views or perspectives are useful when designing and documenting a system’s
architecture?
2. What notations should be used for describing architectural models?
1. Logical view: This view focuses on the main objects or classes in the system. It helps
to connect system requirements with the key components of the system.
2. Process view: This view shows how the system runs in real-time, with processes
interacting. It helps assess performance and availability by looking at system behavior
during execution.
3. Development view: This view shows how the software is divided for development,
detailing the components worked on by individual developers or teams. It’s helpful for
software managers and developers.
4. Physical view: This view shows the hardware and how software components are
distributed across different machines. It’s important for planning how the system will be
deployed in real-world environments.
5. +1: Scenarios: Use cases or scenarios that show how the system behaves in real-life
situations (like how users interact with it).
Why it’s useful: Ties all the views together by showing how the system works in
practice, ensuring that each view meets user needs.
Summary:
In simple terms, the 4+1 View Model suggests that we need different "views" to understand
different aspects of a system:
Logical View: What are the core objects or classes in the system?
Process View: How does the system work when it’s running?
Development View: How is the system broken down for development?
Physical View: How is the system deployed across hardware?
Scenarios: How does the system behave in real-life situations?
Each view shows a different side of the system, and together, they give a full understanding of how
the system works, is built, and will be deployed.
Architectural Patterns
Software architecture is like the blueprint for building software, showing how different
parts fit together and interact.
It helps the development team understand how to build the software according to
customer requirements. There are many ways to organize these parts.
These patterns have been tested and proven to solve different problems by arranging
components in specific ways.
Each pattern also highlights its advantages (what it does well) and its limitations (where it
might not be the best choice).
For example, Figure 6.2 describes the well-known Model-View-Controller pattern, this
pattern is the basis of interaction management in many web-based systems.
MVC (Model-View-Controller)
The MVC design pattern is a software architecture pattern that separates an application
into three main components: Model (which handles data), the View (which is what users
see), and the Controller (which connects the two) making it easier to manage and maintain
the codebase.
It also allows for the reusability of components and promotes a more modular approach to
software development.
This makes it easier to work on each part separately, so you can update or fix things
without messing up the whole app.
It helps developers add new features smoothly, makes testing simpler, and allows for
better user I nterfaces.
Overall, MVC helps keep everything organized and improves the quality of the software.
The Model component manages the system data and associated operations on that data.
The View component defines and 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.
Layered Architecture
In this system, you can replace the database or modify user interface components without affecting
other parts of the system.
Repository Architecture
The Repository Pattern is used in systems where multiple components share a common
database or data repository.
Data is stored in a central repository (e.g., a database or version-controlled system).
It allows different parts of the system to access and update data without needing to
communicate directly with each other.
In systems using the repository pattern, the repository acts as a centralized data storage.
Components (e.g., different tools) don’t need to pass data between each other directly.
Instead, they all interact with the repository to access or update data.
Example: In an Integrated Development Environment (IDE), the repository could store and
track the version history of code.
Components share data by reading from and writing to the repository, without explicitly
sending data to each other.
This method is more efficient for systems that handle large amounts of data, as it avoids the
need for continuous data transfer.
Client–Server Architecture
The Client–Server architecture is a way of organizing systems where services are provided
by servers and used by clients.
A client is a program or device that requests services.
A server is a program or system that provides services to clients.
The major components of this model are:
1. Server: A set of servers that offer services to other components
Examples:
Print servers that offer printing services,
File servers that offer file management services,
Compile server offers programming language compilation services.
2. Clients: Programs that request services from servers
Clients run on different computers and often work simultaneously
3. Network: Connects clients and servers, allowing clients to access services
Figure 6.11 is an example of a system that is based on the client–server model. This is a
multi-user, web-based system for providing a film and photograph library.
In this example:
Think of a pipe and filter as a system where data flows from one step to another, just like water
flowing through pipes in your house. In this case, the pipe is the pathway through which the data
travels, and the filters are the steps where the data gets processed or changed.
Pipe: A pathway where data moves from one point to the next.
Filter: A step where the data is processed, changed, or transformed.
This model is often used in batch systems where data is processed in batches. An example is
a billing system, where payments are processed in steps
In a billing system, invoices are issued, payments are reconciled, and receipts or reminders
are sent. Each of these steps can be seen as a "filter" processing the data
Example: An organization has issued invoices to customers.
Once a week, payments that have been made are reconciled with the invoices
For those invoices that have been paid, a receipt is issued.
For those invoices that have not been paid within the allowed payment time, a reminder is
issued
Disadvantages:
Interactive Systems (like those with graphical user interfaces or real-time user
input, such as mouse clicks or menu selections) are difficult to create using the pipe
and filter mode
Reason: These systems need to react to events and handle complex data formats,
which doesn't fit well into the streaming data flow of the pipe and filter model
Each transformation must parse its input and unparse its output to the agreed form.
___________________________________________________________________________
In short, object-oriented design helps break down complex systems into manageable, independent
parts, making them easier to understand, modify, and maintain.
Figure 7.1, which shows a weather station interacting with three systems in its environment:
a weather information system, an on board satellite system, and a control system.
The control system is linked to multiple weather stations, while there is one satellite system
and one weather information system connected to each weather station.
A use case model is used to represent the interactions between the weather station and
these external systems in a simple, abstract way.
Figure 7.2 shows The use case model for the weather station shows how it interacts with
different systems.
The weather station interacts with the weather information system to report weather data
and its hardware status.
The weather station also interacts with the control system, which can send control
commands to the station.
A stick figure is used in the UML diagram to represent both external systems (like the
weather information system or control system) and human users.
Each use case should be described in natural language to clarify how the system works and
what each interaction involves.
A standard format is used for describing these use cases, detailing what information is
exchanged, how interactions are triggered, and the sequence of actions involved.
Architectural design
The software system's architecture is designed based on the interactions between the
system and its environment
Major components of the system are identified, along with how they interact.
Design Models
o Design models show the objects or object classes in a system and their relationships.
o These models act as a bridge between the system requirements and the system
implementation
o Typically, two main types of design models are developed:
1. Structural models: Show the static structure of the system, including object classes
and their relationships (e.g., inheritance, uses/used-by, and composition
relationships).
2. Dynamic models: Show the dynamic interactions between system objects, such as
the sequence of service requests and the state changes triggered by these
interactions.
Figure 7.7 Sequence diagram describing data collection
o Sequence diagram (Figure 7.7) shows the sequence of interactions when an external system
requests the summarized weather data from the weather station.
o The diagram is read top to bottom, showing the flow of messages between objects.
1. SatComms object: Receives a request from the weather information system to
collect a weather report. It acknowledges the request. The stick arrowhead on the
message indicates that SatComms doesn’t wait for a response and continues with
other tasks.
2. SatComms to WeatherStation: SatComms sends a message to the WeatherStation
to create a summary of the weather data, via a satellite link. Again, the stick
arrowhead indicates SatComms doesn’t wait for a response.
3. WeatherStation to Commslink: WeatherStation sends a message to the Commslink
object to summarize the weather data. The squared arrowhead indicates that
WeatherStation waits for a reply from Commslink.
Interface Specification
Interface specification defines how different parts of a system communicate but doesn’t
show how things work internally.
It allows parallel design. Multiple components or subsystems can be developed at the same
time as long as they follow the same interface specification.
Once an interface is defined, developers can assume that the interface will be implemented
according to the specification, allowing for smooth integration.
In UML (Unified Modeling Language), interfaces are represented similarly to class diagrams,
but with a few differences:
1. There is no attribute section for interfaces.
2. The <<interface>> stereotype is included in the name part to indicate that it is an
interface.
Attributes (data representation) are not defined in an interface. Interfaces do not specify
how data is stored.
However, interfaces define operations (or methods) that allow objects to access or update
data.
There is not a simple 1:1 relationship between objects and interfaces.
An object can have multiple interfaces. Each interface might provide a different viewpoint
of the object's capabilities.
Design Patterns
A pattern is a description of a problem and its solution, offering a reusable solution for
common problems in different contexts.
Describing designs using patterns allows developers to communicate and explain their design
decisions clearly.
The Gang of Four refers to the authors of a famous book on design patterns (Gamma et al.,
1995), which describes widely-used design patterns.
Although design patterns are mostly linked to object-oriented design, the idea of capturing
design solutions can apply to any type of software design.
The Four Essential Elements of Design Patterns (defined by the 'Gang of Four'):
1. Name: It helps to identify and communicate the pattern easily.
2. Problem Description: Helps developers understand the situations or contexts
where the pattern is useful
3. Solution Description: Describes the parts of the design solution, their
relationships, and responsibilities.
4. Consequences: Helps designers understand the impact of applying the pattern in
a specific situation. It shows the benefits and drawbacks, helping decide whether
the pattern is suitable.
The Observer pattern is used in situations where different presentations of an object’s state
are required.
This pattern allows for multiple views of the same object’s state without tightly coupling the
state object to the presentation logic.
Figure 7.11 illustrates two different graphical representations of the same data set,
demonstrating how the Observer pattern works.
The Observer pattern is typically represented graphically, showing the object classes and
their relationships.
Separates object display from different forms of presentation
Utilized when different presentations of an object's state are required.
Implementation issues
Software engineering includes all of the activities involved in software development from the
initial requirements of the system through to maintenance and management of the deployed
system.
A critical stage of this process is, of course, system implementation, where you create an
executable version of the software.
Implementation can involve:
Writing code in high-level or low-level programming languages.
Adapting off-the-shelf software to fit specific needs of an organization.
Key Aspects of Implementation:
1. Reuse:
Most modern software is built by reusing existing components or systems. This
means that instead of writing all the code from scratch, developers use already-built
software components, libraries, or frameworks to save time and effort.
When developing software, it’s essential to reuse as much existing code as possible
to make the process faster and more efficient.
2. Configuration Management:
During the development process, there will be multiple versions of the software
components created
It is about keeping track of all these versions to avoid issues. If you don’t manage
versions properly, you might accidentally use the wrong version of a component,
which can cause errors or unexpected behavior.
3. 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).
The host and target systems are sometimes of the same type but, often they are
completely different
Summary:
Assignment Questions
2 marks
1. Define Architecture Design.
2. What is Client-Server Architecture? (Feb 2024, Exam)
3. List out the types of patterns.
4. List out the Relationship with Non-functional Requirements.
5. Define MVC
6. Define Design Patterns
7. Define Repository Architecture
5 marks
1. Explain Architecture Design Decisions
2. Explain Architecture Views
3. Explain in detail about Layered Architecture
4. Explain in details about Client-server Architecture
5. Explain in details about MVC architecture
6. Explain in detail about Object oriented design using UML or Explain the steps/stages
to Develop Object-Oriented Design (Feb 2024, Exam)
7. Explain Object Class identification
10 marks
1. Explain in detail about Pipe and Filter Architecture
2. Explain Design Models
3. Explain in detail about Repository Architecture (Feb 2024, Exam)