0% found this document useful (0 votes)
14 views60 pages

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)
14 views60 pages

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/ 60

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

Resulting System
Business Goal

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 User 2 User 3

Front end of Front end of Front end of


application application application
(GUI) (GUI) (GUI)

Request
(Txn or Info)

Internet

Web Back end


Inq / update
server / of (JDBC) DB
App server application
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
1 Managing Director What business purpose does it solve? How unique is it from the
competition?
2 Chief Technology Officer Does it adhere to organization standard? Ex: A cloud based mail
service provider would focus only on messaging technology
3 Data Base Designer What information should be stored? Where and how? Access
mechanisms and longevity?
4 Application Development Team How do I implement a complex scenario in code? How should I
organize my code?
5 Users/ Customers Scalability, Performance and Reliability: Ease of use
6 Infrastructure Manager Hardware system required : CPU, RAM and Buffer Memory
specifications : Security requirements : Network standards :
Business continuity plans an backup mechanisms.
7. Release and configuration Build strategy (Daily, weekly , fortnightly) Code Management at
Manager the highest level
8 System Maintenance Team How fast can I 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)
2 : makeLineItem(spec, quantity)
:Register

1:spec := getSpecification(itemID) :Sale

:ProductCatalog

1.1:spec := find(itemID) 2.2 : add(sli) 2.1 : create(spec, quantity)

:ProductSpecification sli:SalesLineItem
:SalesLineItem

Ref: Book: Applying UML and 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

• SA is derived from ref


architecture
• Actual software system
• Reference Model is a set of elements and the way they blueprint derived from
interact requirement
• Architectural Pattern deal with non-functional • Contains design decisions
requirements • Describes how it is deployed
• 1 ,2 and 3 as a stand alone doen not form software • Addresses Quality of Service
architecture concerns
• Reference architecture is a best practice : J2EE / Java
10/5/2024 SS ZG653 29
Structure Vs. Views

Structure : Views :
A set of elements itself as they A view is a representation of
exists in a software or hardware. architectural elements as written
by and read by system
Example: A Module Structure is stakeholders.
the set of the systems module and
their organization. Example: A Module view is the
representation of a structure
documented according to a
template in a chosen notation.

CONFIDENTIAL - RESTRICTED CIRCULATION 30


Component - Connector View
Example (Client-Server)

CONFIDENTIAL - RESTRICTED CIRCULATION 31


3 Types of Structures

1. Module Structure 2. Component and 3.Allocation Structure


❑ Static in Nature Connector (C-C) Structure
❑ Dynamic in nature
❑ Modules (A set of code ❑ Dynamic in nature
❑ Show relationship
units) are assigned ❑ Focus on the way
between software
specific computational elements interact with
responsibilities each other at run-time elements and one or
to carryout the system more external
❑ Modules are the basis
of work assignments functions environments
for programming ❑ Elements are run-time ❑ Ex: What processor
Teams components does each software
❑ Ex., Team “A” work on (responsible for element execute on?
D/B, Team “B” on computation) &
Business Rues & Team Connectors (vehicle
“C” on User Interface for communication)

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

Enterprise architecture focuses on how the


System focuses on mapping of functionalities
Business Processes and Goals are met with a
on to Hardware and Software Components
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
Quality
Software Element
Relations Useful for Attribute
Structure Type
Affected

Resource Information
Decomposition Module “is’ a sub module of hiding, encapsulation Modifiability
allocation,

Module Engineering subsets, Subsetability


Uses Module Uses
Structure Engineering extensions Extensibility

Incremental
Layers Layer Uses the service of Development, Virtual Portability
Machines
Class, Object-Oriented Design Modifiability
Class Is an instance of
Object Systems Extensibility
Modifiability
(One, many) to (one, Consistency and
Data Models Data Entity Performance
many) performance
CONFIDENTIAL - RESTRICTED CIRCULATION 39
Relationship Among the Structures

Quality
Software
Element Type Relations Useful for Attribute
Structure
Affected

Service, Enterprise
Software Bus
C&C (helps in Scheduling Analysis,
Structure Service Runs concurrently Interoperability
distributing with the Performance
with Modifiability
connected Analysis
components),
Registry

Processes, Identifying locations


Performance,
Concurrency Threads Can run parallel where resource
Availability
contention exist

CONFIDENTIAL - RESTRICTED CIRCULATION 40


Relationship Among the Structures

Quality
Software
Element Type Relations Useful for Attribute
Structure
Affected

Components, Performance, Performance,


Allocated to
Deployment Hardware Availability, Security Security,
Allocation Migrated to
elements Analysis Availability
Structure

Modules Configuration control,


Development
Implementation File structures Stored in Integration, test
efficiency
activities

Modules, Project Management,


Work Development
Organizational Assigned to Management of
Assignment efficiency
units commonality
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 topology, communication, security
• concerned with functionality • essentially allocation (deployment). Other people also
• essentially module structure call it as deployment view

Use-case- Binds all the four Logical View Physical View


views together and describes
the behavior of the system in Use case/ Scenarios
a semi-structured text Development
Process View
View
Development team
Architect/Integrator
• concerned with software management
• concerned with performance, scalability..
• essentially allocation (implementation and work-
• essentially component-connector
assignment)
10/5/2024 SS ZG653 42
Two views of a Client-Server System

Client Software as one module & 11 Components and 10


Server Software as other module Connections
Module Decomposition View of CC Model View of Client-Server
Client-Server Architecture Architecture
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 CONFIDENTIAL


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

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
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 (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 3. Business 4. Professional
Cycle

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.,)

Sl. # Software Attribute Focus Elements of the Architecture


1 Performance Time based behavior of elements, use of shared resources &
frequency and volume of inter element communication

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

4 Testability Testability of individual elements


5 Interoperability Elements responsible for 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

End User: UI, performance, reliability


Architect
, security

Maintenance : Modifiability

Skill Competency Customer : Low cost, timely delivery

CONFIDENTIAL - RESTRICTED CIRCULATION 56


In summary

✓ Software Architecture (SA) is a ✓ Structure refers to ELEMENTS in


BLUE PRINT of the software the software: View is a TEMPLATE
(Visualization of the Final Outcome), to depict them.
will enable design and Coding. ✓ Structure: Module, Component &
✓ SA BINDS ELEMENTS, establishes Connector and Allocation
relationship and reflects properties ✓ View : Logical, Physical, Process
of them. and Deployment
✓ SA deals primarily with Non- ✓ Use Philippe Kruchten's (4+1)
Functional Requirements Model to decide on the relevant
✓ SA is derived only from Reference structure
Architecture ✓ Understand the properties of a
✓ STRUCTURES & VIEWS are the Good Architecture
basic Software Architectural ✓ The context of a Software
Engineering 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