0% found this document useful (0 votes)
6 views

SA - CS01

Uploaded by

Kiran Rocky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

SA - CS01

Uploaded by

Kiran Rocky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 93

Software

Architecture
Software Architecture – CS -1
Topics To Be Covered
❑Software architecture – definition,
❑Need for architecture,
❑Architecture role,
❑Structures and Views
❑Patterns of various architectures
❑Contexts of Architecture

CONFIDENTIAL - RESTRICTED CIRCULATION 3


Study Material
❑ Text
Books
– Len Bass et al, Software

Architecture in Practice, Pearson, Third (or Second) Edition,


ISBN 9789332502307
– F. Buschmann et al, Pattern Oriented
Software Architecture – Volume1, Wiley, 1996
CONFIDENTIAL - RESTRICTED CIRCULATION 4

Architecture

Business Goal
Resulting

System
It’s
a
connecting bridge between Business Goal and the
Resulting System
CONFIDENTIAL - RESTRICTED CIRCULATION 5

Architecture of a Car
CONFIDENTIAL - RESTRICTED CIRCULATION 6

What is software architecture?


Before we define this, let us look at examples of architecture from
construction industry

Example of a building
architecture
Example of a building
architecture
Based on these pictures, how can we define building architecture?

So, what is architecture of a building?

• Blue print of the building, that shows


• Layout of the building
• Different sections of the building
• Relationships between different sections

• Can be High level or detailed

Software architecture Now let us


look at examples of software architecture…

Web appl architecture


User 1

Front end of
application Internet
(GUI)

Request
(Txn or Info)

Back end
User 3

Front end of
application
Web (GUI)
User 2

Front end of
application
(GUI)
Inq / update
server / of

App serverDB
application
(JDBC)
DB server

What is software architecture?

Can we try to define ‘Software architecture’?


What is software architecture?
Software architecture depicts the organization of software components
and how the software system works.

It shows:

• The arrangement of software components


• Connection and interaction between software components •
Distribution of software components across different computing
systems
Software
Architecture (SA)
It is a
blue
print of a
software system for the stakeholders to understand how the
system would be once it is implemented
.
A

blue print should


have higher level of abstractions (system functions) – it is not the
detailing of how code should be written – at the same time should
not have sea of information.

Different stake holders expect


certain information as a justification for building a software and all
their expectations must be addressed in Software Architecture.

Business
Requirement
Software Design
Specification SA

CONFIDENTIAL - RESTRICTED CIRCULATION 16

Who are
all the stake holders?
Sl. # Stake Holder Expectation
What business purpose does it solve? How unique is it from
Managing the competition?
1 Director
Does it adhere to organization standard? Ex: A cloud based
mail service provider would focus only on messaging
2 Chief Technology Officer technology

What information should be stored? Where and how?


Data Access mechanisms and longevity?
3 Base Designer
How do I implement a complex scenario in code? How
should I organize my code?
4 Application Development Team

Users/ Scalability,
5 Customers Performance and Reliability: Ease of use
Hardware system required : CPU, RAM and Buffer Memory
specifications : Security requirements : Network standards :
6 Infrastructure Manager Business continuity plans an backup mechanisms.
Release and Build strategy (Daily, weekly , fortnightly) Code Management
configuration Manager at the highest level
7.

How fast can I


8 System Maintenance Team diagnose a fault and solve?

CONFIDENTIAL - RESTRICTED CIRCULATION 17

Software Architecture -

Definition
The software architecture of a
system is the set of structures needed to reason about
the system which comprise software elements,
relationship among them and properties of both.

The reason is to justify why is this required from the perspective of a stake
holder who has vested interest in it.

CONFIDENTIAL - RESTRICTED CIRCULATION 18


Is this an
Architecture ?
What we understand •
The system has 5
elements
• They are
interconnected
• One is on the top of
another

Does this answer to all the expectations of the stake holders?


It is not !!!

10/5/2024 SS ZG653 19

What it does not


address?
• Visible responsibilities

– What do they do?



How
does
their function relate
to the system? –
How have these elements been derived, is there any
overlap?

• Are these processes, or programs ?

– How do they interact when the


software
executes? –
Are they
distributed?

• How are they deployed on a hardware ? •


What information does the system process?
CONFIDENTIAL - RESTRICTED CIRCULATION 20

What it does
not address? .. Continued
• Significance of
connections

– Signify control or data, invoke each other,


synchronization
– Mechanism of communications
• Significance of layout
– Does level shown signify anything?
– Was the type of drawing due to space constraint?

CONFIDENTIAL - RESTRICTED CIRCULATION 21

Then,
what an architecture should address?
• A structure describing

– Modules
• Services offered by each
module
• Their interactions- to achieve
the functionality
– Information/data modeling
– Achieving
quality
attributes
– Processes and tasks
that execute the
software – Deployment
onto hardware

– Development plan
CONFIDENTIAL - RESTRICTED CIRCULATION 22

Then, what
an architecture should address? .., contd

•A

behavioral description

– describing how
the

structural elements execute “important” and


“critical” scenarios
• E.g. how
does the
system authenticates a mobile user? • How does the
system

processes 1 TB of data in a day? • How does it stream


video uninterruptedly during peak load?
– These scenarios are mainly to
implement various quality attributes

CONFIDENTIAL - RESTRICTED CIRCULATION 23

Example of architecture
https://www.infoq.com/articles/why-architectural-diagrams/

Example of design of Point-of


Sale
system (partial design)
addLineItem(itemID, quantity) :Register

1:spec := getSpecification(itemID) :Sale

:ProductCatalog

2.2 : add(sli) 2.1 : create(spec, quantity)


1.1:spec := find(itemID)
2 : makeLineItem(spec, quantity)
:SalesLineItem
sli:SalesLineItem
Ref: Book: Applying UML and
:ProductSpecification Patterns by Craig Larman

BITS Pilani, Hyderabad Campus


Architecture of Windows

https://http://blogs.msdn.com/b/hanybarakat/archive/2007/02/25/deeper-into-windows-architecture.aspx
This is only a part of architecture showing various modules and components
CONFIDENTIAL - RESTRICTED CIRCULATION 26

Architecture of Android
http://www.techotopia.com/index.php/An_Overview_of_the_Android_Architecture

Layered architecture of Android for mobile application


development – showing layer wise modules and key components
CONFIDENTIAL - RESTRICTED CIRCULATION 27
Architecture Styles

❑ Architectural Styles is also termed as Architectural Pattern ❑


Style is a set of element types, a

module or unit of computation (ex., an element to store data)


❑ A set of interaction types – how do they interact with each
other?
❑ Eg.,

Publish-Subscribe is a
modus operandi for
exchange of
information: A Function call – Module “A” calling some components of
“Module B” through a call manager

Topology indicating interaction and interaction types ❑


Defining constraints ( What are all allowed and what are all not
allowed?)

CONFIDENTIAL - RESTRICTED CIRCULATION 28


Relationship Between Reference Model And Architectural Pattern

non-functional requirements
• 1 ,2 and 3 as a stand alone doen not
form software architecture

• •

Reference Model is a set of elements and the way


they interact Reference architecture is a best practice : J2EE /
• Architectural Pattern deal with Java
• SA is derived from
ref architecture decisions •
• Actual software Describes how it
system blueprint is deployed •
derived from Addresses Quality of Service concerns
requirement
• Contains design

10/5/2024 SS ZG653 29

Structure Vs.
Views
Views :
Structure
:
architectural elements as written
by and read by system

A set of elements itself as they


exists in a software or hardware.

A view is a representation of

the systems
module and
stakeholders.
Example: A Module
Structure is the set of
their organization.

documented according to a
Example: A Module view is the template in a chosen notation.

CONFIDENTIAL - RESTRICTED CIRCULATION 30

representation of a structure
Component - Connector
View
Example (Client-Server)
CONFIDENTIAL - RESTRICTED CIRCULATION 31

3 Types of Structures
2. Component and
1. Module Structure
❑ ❑ Modules are the basis
Static in Nature of work assignments
for programming
Teams Connector (C-C) Structure

❑ Dynamic in nature ❑
Focus on the way
❑ Modules (A set of code ❑
units) are assigned Ex., Team “A” work on
specific computational D/B, Team “B” on
responsibilities Business Rues &
Team “C” on User
Interface
elements interact with
each other at run-time
to carryout the system
functions elements
❑ and one
or more
Connectors (vehicle external
for communication)
Elements are run-time
components
environments

(responsible for

3.Allocation Structure
Ex: What processor
computation) & does each software
❑ Dynamic in nature ❑ element execute on?
Show relationship
between software

CONFIDENTIAL - RESTRICTED CIRCULATION 32


How do these structures help?
1. Module Structure will bring
answers to :

❑ What is the primary functional responsibility


assigned to each module?

❑ What other software elements is a module


allowed to use?

❑ What other
software does
it actually use
and depend on?

❑ What modules are related to other modules by generalization or specialization


(inheritance) relationships?

2. Component and
Connector (C-C) Structure will bring answers to :

❑ What are the major executing


components and how do they interact at
runtime?
❑ What are the major shared data stores?

❑ Which parts of the system are replicated?

❑ How does data progress through the system?

❑ What parts of the system can run in parallel?

❑ Can the system's structure change as it executes and, if so, how?

3.Allocation Structure


What

processor does each software element execute on?


❑ In what directories or files is each element stored during development, testing, and system building?

❑ What is the assignment of each software element to development teams?

CONFIDENTIAL - RESTRICTED CIRCULATION 33

A Typical C-C Structure


Over View

CONFIDENTIAL - RESTRICTED CIRCULATION 34

System Vs. Enterprise Architecture


System focuses on mapping of functionalities Enterprise architecture focuses
on to Hardware and Software Components on how the Business Processes and Goals
are met with a human touch.
CONFIDENTIAL - RESTRICTED CIRCULATION 35
Module
Structures
1. Decomposition Structures: Modules are decomposed into smaller modules recursively
until the modules are small enough to be easily
understood. The decomposition structure
determines,
to a large
degree, the
system's modifiability, by assuring that likely changes are localized. Used as a basis for
the Development Project Organization.
2. Uses structure : The units here are also modules, perhaps classes. A unit of software
uses another in this model. The uses structure is used to engineer

systems that can be extended to add functionality. Useful for incremental


development.
3.
Layer
Structure :Components are hierarchically organized as a layer. This structure is
used in system requiring portability, the ability to change the
underlying computing platform (mobile devices).
4.

Class Structure: The class structure allows one to reason about reuse and the
incremental addition of functionality. If any documentation exists for a
project that has followed an object-oriented analysis and
design process, it is typically this structure.
5. Data
Model :
The
data
model describes the static
information structure in terms of data entities and their relationships. For
example, in a banking system, entities will typically include
Account, Customer, and Loan. Account has several attributes, such as account number, type
(savings or checking), status, and current balance.
CONFIDENTIAL - RESTRICTED CIRCULATION 36

Component
and Connector Structures
1. Service Structures: The units here are services that
interoperate with each other
by service coordination mechanisms such as SOAP(Simple Object
Access Protocol).This will help engineer a system composed of components
developed anonymously and independently of each other.
2. Concurrency structure : This component-and-connector
structure allows the
architect to determine opportunities for parallelism and the locations where
resource contention may occur. The concurrency structure is used early in the
design process to identify the requirements to manage the issues associated with
concurrent execution.
CONFIDENTIAL - RESTRICTED CIRCULATION 37

Allocation Structures
1. Deployment Structures: The deployment structure shows
how software is
assigned to hardware processing and communication elements. This structure can
be used to reason about performance, data integrity, security, and availability.

2.
Implementation structure : This structure shows how software elements (usually

modules) are mapped to the file


structure(s) in the system's
development, integration, or configuration control environments.

3. Work Assignment Structure: This structure assigns


responsibility for
implementing and integrating the modules to the teams who will carry it out. This
structure will also determine the major communication pathways among the teams:
regular teleconferences, wikis, email lists, and so forth.

CONFIDENTIAL - RESTRICTED CIRCULATION 38

Relationship Among the Structures


Module Software Element Quality
Structure Structure Type Useful Attribute
Relations for Affected
Module “is’ a sub module of Resource
Information hiding,
Decomposition encapsulation Modifiability
allocation,
Module Uses Engineering subsets, Subsetabili
Uses Engineering ty
extensions Extensibilit
y
Layer Uses the service of Incremental
Development,
Layers Virtual Machines Portability
Class, Is an instance of Object-Oriented Modifiabili
Class Object Design Systems ty
Extensibili
ty
Data Entity (One, many) to Consistency and Modifiabili
(one, many) performance ty
Data Models Performan
ce

CONFIDENTIAL - RESTRICTED CIRCULATION 39


Relationship Among the Structures
C&C Software Quality
Structure Structure Useful Attribute
Element Type Relations for Affected

Service, Runs Scheduling Interoperabili


Enterprise concurrently Analysis, ty
Service Software Bus with Performance Modifiability
(helps in Analysis
distributing with
the connected
components),
Registry
Processes, Can run parallel Identifying Performance,
Threads locations where Availability
Concurrency resource
contention exist
CONFIDENTIAL - RESTRICTED CIRCULATION 40

Relationship Among the Structures


Quality
Useful Attribute
Element Type Relations for Affected

Performance, Performance,
Component Allocated to
s, Availability, Security,
Migrated to Availability
Hardware Security Analysis
elements

Modules Stored in Configuration Development


File structures control, Integration, efficiency
test
activities
Modules, Assigned to Project Development
Organization Management, efficiency
al units Management of
commonality

Software
Structure

Deployment
Allocation
Structure

Implementation

Work
Assignment

CONFIDENTIAL - RESTRICTED CIRCULATION 41


Which
Structure to
Choose?
Philippe Kruchten's 4+1 View
Model
• Many

opinions exist
• We will consider 4+1 view. This has been
institutionalized as Rational Unified Process
of Architecture description

Infrastructure team
End-user
• concerned with Use-case- Binds all the four views together and
functionality • essentially describes the behavior of the system in a
module structure semi-structured text
Development

Architect/Integrator

• concerned with topology, communication, security


• essentially allocation
(deployment). Other people View
also
call it as deployment view
Development team

• concerned with performance, scalability.. •


essentially component-connector

Logical View

Physical View
concerned with software management • essentially
Use case/ Scenarios allocation (implementation and work assignment)
Process View
10/5/2024 SS ZG653 42
Two views of a

Client-Server System
Module Decomposition View of
Client-Server Architecture
11

Components
and 10

Connections
CC Model
View of

Client Software as one module & Client-Server Architecture


Server Software as other module
CONFIDENTIAL - RESTRICTED CIRCULATION 43

Architectural

Patterns –

Module Type
Layered pattern :

❑ When the uses relation among software


elements is strictly unidirectional, a
system of layers emerges
❑ A layer is a coherent set of related
functionality. In a strictly layered structure,
a layer can only use the services of the
layer immediately below it.

❑ Layers are often designed as abstractions


(virtual machines) that hide
implementation specifics below from the
layers above, engendering portability

CONFIDENTIAL - RESTRICTED CIRCULATION 44

Layered

Architecture - Example
CONFIDENTIAL -

RESTRICTED CIRCULATION 45

Architectural
Patterns : C-C Type

Shared-data 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.

Shared Data Pattern - Example CONFIDENTIAL - RESTRICTED CIRCULATION 46

Client – Server
Architecture
Core Banking System is a classical Example CONFIDENTIAL -
RESTRICTED CIRCULATION 47
Architectural Patterns : Allocation Type

Multi-Tier pattern. Describes how to

distribute and
allocate the components of a

system in distinct
subsets of hardware and
software, connected
by some

communication medium.
Competence Center & Platform

In competence center, work is allocated to


sites depending on the technical or domain
expertise located at a site.
For example, user-interface design is done
at a site where usability engineering experts
are located.
In platform, one site is tasked with
developing reusable core assets of a
software product line, and other sites
develop applications that use the core
assets

CONFIDENTIAL - RESTRICTED CIRCULATION 48

What
Makes a
Good Architecture?
Structural Rules of Thumb
Process 1. The architecture should feature well-defined modules
Perceptiveness whose functional responsibilities are assigned on
the principles of information hiding and
1. The architecture should be the product of a single
separation of concerns
architect or a small group of architects with
an identified technical leader 2. Your quality attributes should be achieved using
well-known architectural patterns and tactics 3. The
2. The architect (or architecture team) should, on an architecture should never depend on a particular
on-going basis, base the architecture on a
version of a commercial product or tool.
prioritized list of well-specified quality
4. Modules that produce data should be separate from
attribute requirements
modules that consume data
3. The architecture should be documented using
5. Don't expect a one-to-one correspondence between
views. The views should address the
modules and components (Place for parallelism)
concerns of the most important stakeholders
6. Every process should be written so that its
in support of the project timeline
assignment to a specific processor can be easily
4. The architecture should be evaluated for its ability changed, perhaps even at runtime
to deliver the system's important quality
7. The architecture should feature a small number of
attributes.
ways for components to interact
5. The architecture should lend itself to incremental 8. The architecture should contain a specific (and small)
implementation, to avoid having to integrate set of resource contention areas, the resolution
everything at once as well as to discover of which is clearly specified and maintained.
problems early

CONFIDENTIAL - RESTRICTED CIRCULATION 49

Why is Software
Architecture so Important?
1.
An Architecture will inhibit or enable a
system's driving quality attributes (performance, modifiability, security, scalability,
interoperability etc).

2.
The decisions made in architecture allow you
to reason about and manage change as the system evolves (local, non-local and
architectural).

3.
The analysis of architecture enables early prediction of a
system's qualities without waiting for the complete system developed.

4.
A documented architecture enhances communication among
stakeholders (customer, user, Project Manager, coder, tester).
5.
The architecture is a carrier of the earliest and hence most
fundamental, hardest-to-change design decisions (Singe processor or distributed systems
, layered or not, encryption required or not, OS dependency, etc.,).

6.
An architecture defines a set of constraints on subsequent implementation
(Trade off on quality attributes).

7.
The architecture dictates the structure of an organization, or vice versa (Work
Breakdown structure). CONFIDENTIAL - RESTRICTED CIRCULATION
50

Why is Software Architecture so

Important?
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
schedule.

about cost and


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 (Transformation from KLOC to composing or assembling


elements).

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
CONFIDENTIAL - RESTRICTED CIRCULATION 51

Many Contexts of Software Architecture


Contexts

2. Project Life
1. Technical

Cycle 3. Business 4. Professional

1. Technical : What technical role does the software architecture


play in the system or

system of which it’s a part?


2. Project Life Cycle : How does a software architecture
relate to the other phases of a
software development life cycle?
3. Business : How does the presence of a software architecture
affect an organizations
business environment?

4. Professional : What is the role of a software architect in an organization or in a


development project?CONFIDENTIAL - RESTRICTED CIRCULATION 52

1.Technical Context of Software Architecture An

Architecture will inhibit or enable a system's driving


quality attributes

(performance,

modifiability, security,
scalability, interoperability etc.,)

Focus Elements of the Architecture


Sl. # Software Attribute

Time based behavior of elements, use of shared resources


& frequency and volume of inter element communication
1 Performance

2 Availability How components take over for each other in the event of a failure
Isolating the details of user interface & elements responsible
Usability for user experience
3

Testability of individual
4 Testability elements

Elements responsible for


5 Interoperability
external interactions

CONFIDENTIAL - RESTRICTED CIRCULATION 53

2. Software

Architecture in a Project Life-cycle context

Waterfall
Iterative

Agile

Model-Driven

Irrespective of the software development models, the


software architecture will help achieving the following objectives across the project life-cycle.

1.
Making
Business Case for the system (Cost, Time and Approval)
2. Understanding
the architecture
significant
requirements (finite-state machine model for safety
critical systems: use case and scenario for object
oriented analysis: prototyping) 3. Creating or selecting the architecture
4.
Documenting & Communicating the architecture
5. Analyzing or evaluating the architecture (ATAM :
Architecture and Trade-off Analysis Method) 6.
Implementing and testing the system

7. Ensuring that implementation conforms to the architecture

CONFIDENTIAL - RESTRICTED CIRCULATION 54

3.
Software Architecture in a Business context

Business Goals Quality Attributes

Architecture

Non-architectural Solutions

The
Business Goals of a Development
organization for acquiring a software system is different from a customer
organization.
CONFIDENTIAL - RESTRICTED CIRCULATION 55

4.
Software Architecture in a Professional Context
Must be able to meet requirements of
different stakeholders:

Developing Organization : Low

cost, keeping people employed

Duties

Marketing : Unique
features, Low cost, parity with competition,
short time to market
Architect
Maintenance :
End User: UI, performance,
reliability , security Modifiability

Skill Customer : Low cost, timely delivery


Competency

CONFIDENTIAL - RESTRICTED CIRCULATION 56

In
summary
✓ SA

deals primarily with Non


Functional Requirements
✓ SA is derived only
from

Reference Architecture
✓ STRUCTURES & VIEWS are the
basic Software Architectural
Engineering

✓ Software Architecture (SA) is a


BLUE PRINT of the software ✓
(Visualization of the Final Outcome),
will enable design and Coding.
✓ SA BINDS ELEMENTS, establishes
relationship and reflects properties
of them.
Structure refers to ELEMENTS in Use
the software: View is a TEMPLATE Philippe
to depict them. Kruchten's
✓ (4+1) Model to decide on the
relevant structure
✓ Understand the
Structure: Module, Component &
Connector and Allocation
✓ View : Logical, properties of a Good Architecture
✓ The context of a

Physical, Process and


Deployment
Software Architecture varies from

the person who views it (Technical,
Project Life Cycle, Business &
Professional)

CONFIDENTIAL - RESTRICTED CIRCULATION 57

Many contexts of architecture


Context Description
Technical • Enables achieving the quality attributes such as performance,
availability, security, etc.
• Depends on the technology available such as mainframe, client
server, web based, Object oriented, cloud based, etc.
Project Life • Architecture is created on requirements (ASR)
cycle • It is used to develop software
• It is used during testing, eg. Integration testing, performance
testing, etc.
Business • Business goals result in quality attributes such as response time of 3
seconds, uptime of 99.999%
• Quality attributes influence architecture
Professional • An architect should not only have good technical knowledge but
also be able to explain stakeholders why certain quality
attributes have been given higher priority (trade offs), why
certain expectations are not being fulfilled

Web Links
What is Software Architecture? (youtube.com)

Difference Between Software Architecture and Software


Design | Scott Duffy (youtube.com)

Architectural Structures & Views (SA&DP)

(youtube.com) Top 5 Most Used Architecture Patterns

(youtube.com)
CONFIDENTIAL - RESTRICTED CIRCULATION 60

You might also like