Sa Unit1
Sa Unit1
Sa Unit1
UNIT -1
Envisioning Architecture:
1. Where Do Architectures Come From?
Architecture is the result of a set of business and technical decisions. There are many influences
at work in its design, and the realization of these influences will change depending on the
environment in which the architecture is required to perform.
An architect designing a system for which the real-time deadlines are believed to be tight will
make one set of design choices; the same architect, designing a similar system in which the
deadlines can be easily satisfied, will make different choices.
1. What is Software Architecture?
Software architecture is the set of design decisions which, if made incorrectly, may cause your project
to be cancelled. —
1. Architecture will inhibit or enable a system’s driving quality attributes.
2. The decisions made in an architecture allow you to reason about and manage change as the system
evolves.
3. The analysis of an architecture enables early prediction of a system’s qualities.
4. A documented architecture enhances communication among stakeholders.
5. The architecture is a carrier of the earliest and hence most fundamental, hardest-to-change design
decisions.
6. An architecture defines a set of constraints on subsequent implementation.
7. The architecture dictates the structure of an organization, or vice versa.
8. An architecture can provide the basis for evolutionary prototyping.
9. An architecture is the key artifact that allows the architect and project manager to reason about cost
and schedule.
10. An architecture can be created as a transferable, reusable model that forms the heart of a product
line.
11. Architecture-based development focuses attention on the assembly of components, rather than
simply on their creation.
12. By restricting design alternatives, architecture channels the creativity of developers, reducing
design and system complexity.
13. An architecture can be the foundation for training a new team member.
There are three classes of influence that come from the developing organization: immediate
business, long-term business, and organizational structure.
ARCHITECTURES ARE INFLUENCED BY THE BACKGROUND AND EXPERIENCE
OF THE ARCHITECTS
If the architects for a system have had good results using a particular architectural approach, such
as distributed objects or implicit invocation, chances are that they will try that same approach on
a new development effort. Conversely, if their prior experience with this approach was
disastrous, the architects may be reluctant to try it again. Architectural choices may also come
from an architect's education and training, exposure to successful architectural patterns, or
exposure to systems that have worked particularly poorly or particularly well. The architects may
also wish to experiment with an architectural pattern or technique learned from a book (such as
this one) or a course.
A business manages this cycle to handle growth, to expand its enterprise area, and to take
advantage of previous investments in architecture and system building. Figure 2 shows the
feedback loops. Some of thefeedback comes from the architecture itself, and some comes from
the system built from it. The architecture affects the structure of the developing organization. An
architecture prescribes a structure for a system; as we will see, it particularly prescribes the units
of software that must be implemented (or otherwise obtained) and integrated to form the system.
These units are the basis for the development project's structure. Teams are formed for individual
software units; and the development, test, andintegration activities all revolve around the units.
Likewise, schedules and budgets allocate resources in chunks corresponding to the units. If a
company becomes adept at building families of similar systems, it will tend to invest in each
team by nurturing each area of expertise. Teams become embedded in the organization's
structure. This is feedback from the architecture to the developing organization.
Figure 2. The Architecture Business Cycle
ARCHITECTURE ACTIVITIES
As indicated in the structure of the ABC, architecture activities have comprehensive feedback
relationships with each other. We will briefly introduce each activity in the following
subsections. Creating the Business Case for the System
1. Creating a business case: is broader than simply assessing the market need for a system. It is
an important step in creating and constraining any future requirements. How much should the
product cost? What is its targeted market? What is its targeted time to market? These are all
questions that must involvethe system's architects.
2. Understanding the Requirements: There are a variety of techniques for eliciting
requirements from the stakeholders. For example, object-oriented analysis uses scenarios, or "use
cases" to embody requirements. Safety-critical systems use more rigorous approaches, such as
finite-state- machine models for formal specification languages.
3. Communicating the Architecture
For the architecture to be effective as the backbone of the project's design, it must be
communicated clearly and unambiguously to all of the stakeholders. Developers must understand
the work assignments itrequires of them, testers must understand the task structure it imposes on
them, management must understand the scheduling implications it suggests, and so forth. Toward
this end, the architecture's documentation should be informative, unambiguous, and readable by
many people with varied backgrounds.
3. Communicating the Architecture :
For the architecture to be effective as the backbone of the project's design, it must be communicated
clearly and unambiguously to all of the stakeholders. Developers must understand the work assignments
it requires of them, testers must understand the task structure it imposes on them, management must
understand the scheduling implications it suggests, and so forth. Toward this end, the architecture's
documentation should be informative, unambiguous, and readable by many people with varied
backgrounds.
In any design process there will be multiple candidate designs considered. Some will be rejected
immediately. Others will contend for primacy. Choosing among these competing designs in a rational
way is one of the architect's greatest challenges.
Evaluating an architecture for the qualities that it supports is essential to ensuring that the system
constructed from that architecture satisfies its stakeholders' needs. Becoming more widespread are
analysis techniques to evaluate the quality attributes that an architecture imparts to a system. Scenario-
based techniques provide one of the most general and effective approaches for evaluating an architecture.
The most mature methodological approach is found in the Architecture Tradeoff Analysis Method
(ATAM)
This activity is concerned with keeping the developers faithful to the structures and interaction protocols
constrained by the architecture. Having an explicit and well- communicated architecture is the first step
toward ensuring architectural conformance. Having an environment or infrastructure that actively assists
developers in creating and maintaining the architecture (as opposed to just the code) is better.
Finally, when an architecture is created and used, it goes into a maintenance phase. Constant vigilance is
required to ensure that the actual architecture and its representation remain faithful to each other during
this phase.
A reference model is a division of functionality together with data flow between the pieces. A
referencemodel is a standard decomposition of a known problem into parts that cooperatively
solve the problem.
Reference architecture is a reference model mapped onto software elements (that cooperatively
implement the functionality defined in the reference model) and the data flows between them.
Whereas a reference model divides the functionality, reference architecture is the mapping of
that functionality onto system decomposition. The relationship among these design elements is
shown in Figure 4.
2. Project life cycle - relationship to the other phases of a software development life cycle
Module structures: Here the elements are modules, which are units of implementation.
Modules represent a code-based way of considering the system. They are assigned areas of
functional responsibility. There is less emphasis on how the resulting software manifests itself at
runtime.
SOFTWARE STRUCTURES
Some of the most common and useful software structures are shown in Figure 5. These are
described inthe following sections.
Figure 5: Common software architecture structures
running system.
Shared data This structure comprises components and connectors that
create, store, and access persistent data.
Work This structure assigns responsibility for implementing and
assignment integrating the modules to the appropriate development
teams.
Deployment The deployment structure shows how software is assigned to
hardware-processing and communication elements.
This structure shows how software elements (usually
Implementation
modules) are
mapped to the file structure(s) in the system's development,
integration, or configuration control environments.
6. ARCHITECTURAL PATTERNS:
"A pattern for software architecture describes a particular recurring design problem that arises in
specific design contexts and presents a well-proven generic scheme for its solution. The solution scheme
is specified by describing its constituent components, their responsibilities and relationships, and the
ways in which theycollaborate."
An architectural pattern is determined by:
Architectural patterns
"An architectural pattern expresses a fundamental structural organization schema for software
systems. It provides a set of predefined subsystems, specifies their responsibilities, and includes
rules and guidelines for organizing the relationships between them."
MODULE PATTERN:
1. LayeredPattern: :
As the name suggests, components(code) in this pattern are separated into layers of subtasks and they are
arranged one above another.
• Each layer has unique tasks to do and all the layers are independent of one another. Since each layer
is independent, one can modify the code inside a layer without affecting others.
• It is the most commonly used pattern for designing the majority of software. This layer is also
known as ‘N-tier architecture’. Basically, this pattern has 4 layers.
1. Presentation layer (The user interface layer where we see and enter data into an application.)
2. Business layer (this layer is responsible for executing business logic as per the request.)
3. Application layer (this layer acts as a medium for communication between the ‘presentation layer’
and ‘data layer’.
4. Data layer (this layer has a database for managing data.)
2. Component-and-Connector Patterns
MVC pattern :
The Model-View-Controller pattern (MVC) divides an interactive application into three components.
The model contains the core functionality and data. Views display information to the user. Controllers
handle user input. Views and controllers together comprise the user interface. A change-propagation
mechanism ensures consistency between the user interface and the model.
The model is used to manage information and notify observers when that information changes. The
model is the domain-specific representation of the data upon which the application operates. Domain
logic adds meaning to raw data (for example, calculating whether today is the user's birthday, or the
totals, taxes, and shipping charges for shopping cart items). When a model changes its state, it notifies its
associated views so they can be refreshed.
The controller receives input and initiates a response by making calls on model objects. A controller
accepts input from the user and instructs the model and viewport to perform actions based on that input.
Typical examples of systems that employ the publish-subscribe pattern are the following:
1. Graphical user interfaces, in which a user’s low-level input actions are treated as events that are routed
to appropriate input handlers
2. MVC-based applications, in which view components are notified when the state of a model object
3. Enterprise resource planning (ERP) systems, which integrate many components, each of which is only
interested in a subset of system events
4. Extensible programming environments, in which tools are coordinated through events
5. Mailing lists, where a set of subscribers can register interest in specific topic
SHAREDDATAPATTERN
Shared-data (or repository) pattern. This pattern comprises components and connectors that create, store, and
access persistent data. The repository usually takes the form of a (commercial) database. The connectors are
protocols for managing the data, such as SQL.
Client-server pattern. The components are the clients and the servers, and the connectors are protocols and
messages they share among each other to carry out the system’s work.
PIPE AND FILTER PATTERN: A pipeline consist of a chain of processing elements arranged so that the
output of each element is the input of the next element. Conceptually, it should have a source to provide the
initial data. And then step by step the data will be passed through filters over the pipes. And each filter
supposes to transform the data provided and hand over the transformed data to the next filter through a pipe.
Finally transformed data is handed over the final destination called "Sink".
PEER –PEER PATTERN:
• Peer-to-Peer is a type of decentralized and distributed network architecture in which individual nodes
in the network (called "peers") act as both suppliers and consumers of resources, in contrast to the
centralized client–server model where client nodes request access to resources provided by central
servers.
• Problem Description
• Multiple systems need to share common information and applications along with the resource
demands. A peer-to-peer network is a distributed application architecture that partitions tasks or work
loads between peers. Peers are equally privileged participants in the application.
• Applicable Context
• The nodes in a peer-to-peer network need to operate as both "clients" and "servers"; they both provide
information and services and require information and services from other peers. This arrangement is
very useful for sharing large amounts of information, sharing resources, and sharing services.
• Pattern Constraints
• This pattern is not applicable if the application or the information cannot be distributed on multiple
servers. The scalability of the applications and information access needs to be examined and managed,
since this may be an issue if growth is expected, especially the numbers of peers that communicate
simultaneously. Also, since the information and application is distributed on servers, IT security
becomes and important aspect of the solution.
• Pattern Solution
• Peers make a portion of their resources, such as processing power, disk storage or network bandwidth,
directly available to other network participants, without the need for central coordination. Peers are
both suppliers and consumers of resources, in contrast to the traditional client-server model in
which the resources are divided.
BROKER PATTERN:
3. ALLOCATION PATTERN
MapReduce is a software framework and programming model used for processing huge amounts of
data. MapReduce program work in two phases, namely, Map and Reduce. Map tasks deal with splitting and
mapping of data while Reduce tasks shuffle and reduce the data. The whole process goes through four phases
of execution namely, splitting, mapping, shuffling, and reducing.
MULTI-TIER PATTERN:
Multi-tier pattern, which describes how to distribute and allocate the components of a system in distinct
subsets of hardware and software, connected by some communication medium. This pattern specializes the
generic deployment (software-to-hardware allocation) structure.
ARCHITECTURAL STYLES:
An architectural Style is a specialization of element and relation types, together with a set of constraints on
how they can be used. On the other hand, an architectural Pattern expresses a fundamental structural
organization schema for software systems. It provides a set of predefined subsystems, specifies their
responsibilities, and includes rules and guidelines for organizing the relationships between them.
The architectural styles that are used while designing the software as follows:
1. Data-centered architecture
The data store in the file or database is occupying at the center of the architecture.
Store data is access continuously by the other components like an update, delete, add, modify from the
data store.
Data-centered architecture helps integrity.
Pass data between clients using the blackboard mechanism.
The processes are independently executed by the client components.
2. Data-flow architecture
This architecture is applied when the input data is converted into a series of manipulative components
into output data.
A pipe and filter pattern is a set of components called as filters.
Filters are connected through pipes and transfer data from one component to the next component.
The flow of data degenerates into a single line of transform then it is known as batch sequential.
3. Call and return architectures
This architecture style allows to achieve a program structure which is easy to modify.
The main program or subprogram components are distributed in network of multiple computers.
The main aim is to increase the performance.
4. Object-oriented architectures
The different layers are defined in the architecture. It consists of outer and inner layer.
The components of outer layer manage the user interface operations.
Components execute the operating system interfacing at the inner layer.
The inner layers are application layer, utility layer and the core layer.
In many cases, It is possible that more than one pattern is suitable and the alternate architectural style can
be designed and evaluated.
6. EVENT-DRIVEN
An event-driven architecture uses events to trigger and communicate between decoupled services and is
common in modern applications built with microservices.
• Event-driven architectures have three key components: event producers, event routers, and event
consumers. A producer publishes an event to the router, which filters and pushes the events to
consumers. Producer services and consumer services are decoupled, which allows them to be
scaled, updated, and deployed independently.
ARCHITECTURAL VIEWS
• A view is a representation of an entire system from the perspective of a related set of concerns.
It is used to describe the system from the viewpoint of different stakeholders such as end-users,
developers, project managers, and testers.
• Architecture views are representations of the overall architecture that are meaningful to one or
more stakeholders in the system.
• A decentralised system, on the other hand, is one in which complex behaviour emerges through
the work of lower level components operating on local information, not the instructions of any
commanding influence. This form of control is known as distributed control, or control in which
each component of the system is equally responsible for contributing to the global, complex
behaviour by acting on local information in the appropriate manner.
• The lower level components are implicitly aware of these appropriate responses through
mechanisms that are based on the component's interaction with the environment, including
other components in that environment.
• Decentralized simply means not centralized. The control, as opposed to with a single entity, lies
with the end users. BitTorrent a peer to peer network is an ideal example of this.
• A decentralized network is controlled by a cluster of domain controllers that share the network
load and provide redundancy if one server goes down.
• Decentralized systems just like the distributed architecture have no single points of failure.
Even if several nodes go down, the network as a whole is still up.
• There is no single entity control, so there is zero possibility of the network going down anytime
unless all the nodes go down simultaneously which is a rare possibility when we have systems
connected all over the globe.
• This kind of architecture is almost infinitely scalable, unlike a centralized system in which
scalability depends upon the resources of the organization in charge.
•
Benefits of decentralization