Software Architecture Fundamentals: Styles, Quality Attributes & Evaluation Methods
This article provides a comprehensive overview of software architecture design concepts, covering architecture styles (data flow, call/return, independent components, virtual machine, repository), layered architectures (C/S, B/S, SOA, microservices), quality attributes (performance, reliability, availability, security, modifiability), architecture evaluation methods (SAAM, ATAM, CBAM), reliability design, architecture evolution patterns, middleware, and web architecture scaling strategies.
Reading font
1. Software Architecture Concepts
1.1 Definition
The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships among them.
1.2 Architecture Design and Lifecycle
Architecture design spans the entire software lifecycle:
Requirements Analysis Phase: Build SA model from requirements model, ensure traceability of model transformation. Studying SA in requirements phase threads SA concepts through the whole lifecycle.
Design Phase: SA model description, design and analysis methods, summary and reuse of SA design experience. Includes the classic 4+1 model (logical, process, development, physical views plus unifying scenarios) and UML unified modeling language (logical view: classes/objects; implementation view: physical code files/components; process view: threads/processes; deployment view: software-to-hardware mapping; plus use-case view: requirements analysis model).
Implementation Phase: Development process support based on SA, transition paths from SA to implementation, SA-based testing techniques.
Component Assembly Phase: Interconnection of reusable components, detection and elimination of architectural mismatch during assembly. Middleware provides cross-platform interaction capability between components.
Deployment Phase: High-level architectural views to describe software/hardware models at deployment, analyze quality attributes of deployment schemes.
Post-Development Phase: Maintenance, evolution, reuse. Includes dynamic software architecture (internal execution-induced changes, external reconfiguration requests) and architecture recovery/reconstruction (extracting architecture from implemented systems).
1.3 Architecture Description Language (ADL)
ADL provides concrete syntax and conceptual framework for modeling the conceptual architecture of a software system, supported by an underlying semantic model. Core elements:
Component: Computation or data storage unit.
Connector: Architectural building blocks that model interactions among components and the rules governing those interactions.
Architecture Configuration: Connection graph describing components and connectors in the architecture.
2. Software Architecture Styles
2.1 Data Flow Styles
2.1.1 Batch Processing
Each processing step is a separate program; each step starts only after the previous step finishes. Data must be complete and passed as a whole.
2.1.2 Pipe and Filter
Processing steps are implemented by filters; data transport is handled by pipes.
2.2 Call/Return Styles
2.2.1 Main Program/Subroutine
Single-threaded control; components are main program and subroutines; procedure calls serve as connectors.
2.2.2 Object-Oriented Systems
Built on object orientation and data abstraction; components are instances of objects or abstract data types.
2.2.3 Layered Systems
Each layer provides services to the layer above and acts as a client to the layer below; components implement virtual machines on each layer.
2.2.4 Client/Server
Two-tier and three-tier C/S; three-tier separates presentation, functional, and data layers.
2.3 Independent Component Styles
2.3.1 Process Communication Architecture
Components are independent processes; connectors are message passing (point-to-point, asynchronous/synchronous, remote procedure calls).
2.3.2 Event-Based Systems
Implicit invocation based on events; components do not call procedures directly but trigger or broadcast events.
2.4 Virtual Machine Styles
2.4.1 Interpreter Systems
Contains interpretation engine, storage for interpreted code, engine state recording, source code execution progress recording; includes a virtual machine that simulates hardware execution and key applications.
2.4.2 Rule Systems
Comprise rule set, rule interpreter, rule/data selector, and working memory.
2.5 Data-Centered (Repository) Styles
2.5.1 Repository Style
Central data component stores and maintains data; independent components operate on the central data; connectors are interactions between repository and independent components.
2.5.2 Blackboard Style
Problem-solving model that organizes reasoning steps, control state data, and domain knowledge frameworks; applied in speech recognition, pattern recognition, etc.
2.6 Closed-Loop Control Architecture
Suitable for embedded systems, used for simple closed-loop control problems such as air-conditioning temperature control and cruise control.
2.7 C2 Style
Components and connectors each have a top and a bottom; component top connects to connector bottom, component bottom connects to connector top.
3. Layered Architecture Styles
3.1 C/S Architecture
3.1.1 Two-Tier C/S
Network architecture pattern dividing application functionality into client (presentation layer) and server (data layer).
3.1.2 Three-Tier C/S
Further divides application functionality into presentation layer, functional layer, and data layer.
Presentation Layer: On client, handles user interaction, data display, and input reception.
Functional Layer: Application server layer, handles business logic and application execution; receives requests from presentation layer, interacts with data layer, returns results.
Data Layer: Responsible for data storage and management; performs data operations per functional layer requests and returns results.
Two-tier is simpler; three-tier offers higher security.
3.2 B/S Architecture
Core system functionality concentrated on server; simplifies development, maintenance, and use. Users access via browser without installing client software. Drawbacks:
Lack of dynamic page support, no integrated effective database processing.
Security difficult to control.
Response speed (e.g., query speed) lower than C/S.
Data submission typically page-based; dynamic interactivity weak.
3.2.1 Three-Tier B/S Patterns
MVC: Model (data logic), View (data display), Controller (user interaction). Drawbacks: tight view-controller coupling makes maintenance hard; controller bears excessive business logic.
MVP: MVC variant decoupling View and Model. Presenter acts as middle layer, receives user input, invokes model, updates view; bridges view and model.
MVVM: ViewModel as middle layer coordinating view and model; encapsulates business logic and data transformation, converts model data to view-displayable format.
3.3 Service-Oriented Architecture (SOA)
Service is a logical combination of operations and rules to satisfy a business need, comprising a series of ordered activity interactions supporting user goals.
Service: Self-contained, modular software component callable by different applications or business processes.
Interface: Neutral communication definition independent of hardware, OS, programming language.
Loose Coupling: Services independent; modifying one does not affect others, reducing dependencies, aiding modularity and maintenance.
3.3.1 Core Functions
Service identification and definition: identify business functions and define as independent services.
Service abstraction: hide internal implementation details, expose only interfaces.
Service directory: create service registry for consumer discovery.
Service composition: combine multiple services to build complex business processes.
Service interaction: implement communication and data exchange between services.
3.3.2 Characteristics and Advantages
Reusability: services reusable across applications/processes, improving development efficiency and reducing maintenance cost.
Interoperability: standard protocols enable cross-platform, cross-environment operation.
Standardization: interfaces follow standard protocols (SOAP, REST) for regulated, reliable communication.
Flexibility: system split into independent services, allowing on-demand composition/recomposition for rapid scaling and flexible deployment.
Maintainability: loose coupling reduces dependencies, simplifying maintenance.
3.4 Microservices
Decompose a single application into a suite of small services; each runs in its own process; services coordinate via lightweight communication mechanisms (HTTP/REST, message queues).
3.4.1 Characteristics
Service decomposition: application split into small services each implementing specific business capability.
Independent deployment: each microservice deployable independently without affecting others.
Technological heterogeneity: multiple languages and tech stacks allowed per service.
Ease of maintenance and understanding: each service is independent codebase and deployment unit with clear responsibilities.
High decoupling: services communicate via lightweight mechanisms.
3.4.2 Drawbacks and Challenges
Deployment and operations complexity: manage multiple service units, each requiring deployment, monitoring, management; demands deployment automation.
Inter-service dependency testing and management.
Network latency and errors: inter-service network communication introduces latency and failure modes.
Data consistency hard to guarantee: each service operates independently, requiring consistency across services.
Security issues: multiple network communication points risk data leakage, hijacking.
3.4.3 Microservices vs SOA Comparison
The article includes a diagram comparing the two approaches (not reproduced here).
4. Software Architecture Reuse
4.1 Reuse Types
Opportunistic reuse: reuse any discovered reusable assets during development.
Systematic reuse: plan before development to decide what to reuse.
4.2 Reasons for Reuse
Reduce development effort, time, and cost; improve productivity.
Improve product quality and interoperability.
Simplify product maintenance.
4.3 Basic Process
Construct/acquire reusable assets.
Manage reusable assets.
Use reusable assets.
5. Architecture-Based Software Development (ABSD)
ABSD is a top-down, recursive refinement method emphasizing design driven by combination of business, quality, and functional requirements.
Perspectives and Views: Observe architecture description from different perspectives.
Use Cases and Quality Scenarios: Use cases capture functional requirements; specific scenarios capture quality requirements.
5.1 ABSD Development Model
The model includes the following phases (illustrated in a diagram):
5.1.1 Architecture Requirements
Requirements elicitation: define software functions developers must implement and non-functional quality attribute requirements.
Component identification: generate class diagrams, group classes, package classes into components.
Requirements review: assess whether requirements meet user needs, class grouping rationality, component merging rationality.
5.1.2 Architecture Design
Propose software architecture model: gain understanding of architecture properties through model.
Map identified components into software architecture.
Analyze component interactions.
Produce software architecture.
Design review.
5.1.3 Architecture Documentation
Output architecture specification and quality design specification for testing architecture requirements.
5.1.4 Architecture Review
Identify potential risks, detect defects and errors in architecture design early.
5.1.5 Architecture Implementation
Based on reviewed documented architecture specification, proceed through analysis/design, component implementation, component assembly, and system testing phases.
5.1.6 Architecture Evolution
When requirements change, modify software architecture accordingly: categorize requirement changes, formulate evolution plan, add/delete/modify components, update component interactions, component assembly and testing, final technical review.
6. Domain-Specific Software Architecture (DSSA)
6.1 Basic Concepts
Standard software architecture providing organizational architectural reference for a family of applications in a specific domain.
Vertical Domain: Contains multiple systems within the entire system family.
Horizontal Domain: Defines common functional areas across multiple systems and system families.
6.1.1 Domain Analysis
Obtain domain model describing common requirements among systems in the domain.
6.1.2 Domain Design
Obtain DSSA: solution representing requirements in the domain model.
6.1.3 Domain Implementation
Develop and organize reusable assets based on domain model and DSSA.
6.2 DSSA Participants
Domain experts, domain analysts, domain designers, domain implementers.
6.3 DSSA Domain Establishment Process
Define domain scope.
Define domain-specific elements.
Define domain-specific design and implementation requirements.
Define domain model and architecture.
Generate/collect reusable product units.
7. Software Quality Attributes
Definition: Degree to which a software system conforms to explicitly or implicitly defined requirements.
7.1 Performance
System responsiveness: time to respond to an event, or number of events processed in a given time interval.
7.2 Reliability
Ability to maintain functional characteristics under system/application errors, unexpected or erroneous use.
MTTF (Mean Time To Failure)
MTBF (Mean Time Between Failures)
Fault tolerance: ensure correct behavior when errors occur, perform internal repair.
Robustness: ensure application stays in predefined state when unexpected error events occur.
7.3 Availability
Proportion of time system operates normally; expressed as length between failures or speed of recovery after failure.
7.4 Security
Ability to provide service to authorized users while preventing unauthorized use attempts and denial-of-service attacks.
7.5 Modifiability
Ability to change the system.
Maintainability: fix software after errors.
Extensibility: extend system with new features, replace components with improved versions.
Restructuring: reorganize components and their relationships.
Portability: adapt to multiple hardware platforms, OSs, languages, compilers.
7.6 Functionality
Ability to perform desired work.
7.7 Variability
Ability of architecture to be extended or changed into a new architecture.
7.8 Interoperability
Provide well-designed software entry points for externally visible functional characteristics and data structures.
7.9 Quality Attribute Utility Tree
Four fixed levels from root to leaves:
Root: Overall system goal (e.g., "E-commerce Core System").
Quality Attributes: First-level branches, core quality dimensions (performance, security, availability, maintainability, etc.).
Attribute Refinement: Second-level branches refining quality attributes (e.g., performance → latency, throughput; security → confidentiality, integrity).
Quality Attribute Scenarios: Leaf nodes, concrete measurable requirement descriptions (e.g., "99.9% of transactions respond in <1 second").
7.10 Quality Attribute Scenario Description
Stimulus Source: Entity generating the stimulus.
Stimulus: Condition considered when stimulus arrives at system.
Environment: Conditions under which stimulus occurs.
Artifact: Artifact being stimulated.
Response: Action taken after stimulus arrives.
Response Measure: Measurable response for requirement testing.
8. Software Architecture Evaluation
Evaluation methods: questionnaire/checklist-based, scenario-based, metric-based.
8.1 Sensitivity Points and Tradeoff Points
Sensitivity Point: Property of one or more components affecting a quality attribute.
Tradeoff Point: Property affecting multiple quality attributes; sensitivity point for multiple attributes.
Risk Point: Potential problematic architecture decision impact.
Non-Risk Point: Analysis/description posing no hidden risk.
8.2 Architecture Evaluation Methods
8.2.1 SAAM (Software Architecture Analysis Method)
Focuses on modifiability. Process: scenario development, architecture description, single scenario evaluation, scenario interaction, overall evaluation.
8.2.2 ATAM (Architecture Tradeoff Analysis Method)
Addresses modifiability, security, performance, availability. Process: scenario and requirements collection, architecture views and scenario realization, attribute model construction and analysis, tradeoffs.
8.2.3 CBAM (Cost-Benefit Analysis Method)
Quality attributes bring benefits to stakeholders. Steps: collate scenarios, refine scenarios, prioritize scenarios, allocate utility, identify architecture strategies affecting quality attributes and response levels, determine desired quality attribute levels, calculate total benefit per strategy, select strategy based on ROI considering cost.
8.3 ATAM Evaluation Practice
8.3.1 Presentation
Introduce ATAM.
Introduce business drivers.
Introduce architecture to be evaluated.
8.3.2 Investigation and Analysis
Determine architecture approaches.
Generate quality attribute utility tree: root → utility → quality attribute → scenario → scenario realization.
Analyze architecture approaches: identify risks, non-risks, sensitivity points, tradeoff points.
8.3.3 Testing
Brainstorm and prioritize scenarios.
Analyze architecture approaches.
8.3.4 ATAM Report
All information collected during evaluation: utility tree, generated scenarios, analysis issues, identified risks/non-risks, identified architecture approaches.
9. Software Reliability
9.1 Definition
Ability of software product to perform required functions under stated conditions for a stated period of time.
9.2 Quantitative Metrics
MTTF (Mean Time To Failure): Normal operation time until failure.
MTTR (Mean Time To Recovery): Time from failure to recovery.
MTBF (Mean Time Between Failures): Average failure interval.
MTBF = MTTF + MTTR; shorter MTTR is better.
9.3 Reliability Goals
Described by reliability, failure intensity, mean time to failure, etc.
9.4 Reliability Management Across Phases
Requirements Analysis: Determine reliability goals, establish management framework.
Preliminary Design: Reliability metrics, reliability design.
Detailed Design: Reliability design, reliability prediction.
Coding: Reliability testing, collect reliability data.
Testing: Reliability testing, reliability modeling and evaluation.
Implementation: Reliability testing, reliability evaluation.
9.5 Reliability Design
9.5.1 Design Principles
Fault tolerance technology design.
Reduce complexity.
Error detection techniques.
9.5.2 N-Version Programming
Adds three phases: diverse specification review, diversity confirmation, back-to-back testing.
Addresses N-version synchronization, inter-program communication, voting algorithms, consistency comparison, data diversity.
9.5.3 Recovery Blocks
Ensure independence between primary and alternate blocks; minimize commonality.
Must guarantee correctness of acceptance test program.
9.5.4 System Configuration Techniques
Dual-machine hot standby, server clustering.
9.6 Reliability Testing
Determine reliability objectives: ensure software meets reliability requirements.
Develop operational profile: model software usage behavior, develop usage models.
Design test cases: design test schemes for specific functions or combinations, document them.
Test execution.
Test result analysis.
9.7 Reliability Evaluation
Select reliability model.
Collect reliability data.
Reliability assessment and prediction.
10. Software Architecture Evolution
Typical evolution path:
Monolithic architecture
Vertical architecture
Introduce caching (cache-DB consistency issues, cache technology comparison, Redis distributed storage, data sharding, eviction algorithms, persistence, cache avalanche, cache penetration, cache preheating/update/degradation)
Service clusters
Database read-write separation
Reverse proxy and CDN
Distributed file systems and distributed databases
Search engines and NoSQL
Business splitting
Distributed services
11. Software and Middleware
11.1 Components
Component: assembly unit with specified interface specification and explicit context dependencies.
Independent deployment unit.
Third-party assembly unit.
No externally visible state.
Component is a set of atomic components deployed together; difference: most atomic components not deployed individually.
Atomic component: a module plus a set of resources.
11.2 Middleware
Middleware is a class of components and also a class of system software. Roles:
Requirement-oriented: designers focus on business logic.
Business separation and inclusivity: functional partitioning by business, reflected in different interfaces/interaction modes.
Design-implementation isolation: via interfaces, no need to know internals.
Isolate complex system resources: separate system resources from application components.
Standardized interaction models: implement architectural models, standard protocols.
Software reuse: provide component encapsulation, interaction rules, environment isolation, enabling reuse solutions.
Manage application components: components partitioned via identification mechanisms for management.
11.3 Component Reuse
Horizontal reuse: cross-industry, general; Vertical reuse: industry-specific, specialized.
11.3.1 Retrieval and Extraction
Keyword-based retrieval: tree or directed acyclic graph structure.
Faceted retrieval: use Facet to describe component function, operated data, application context.
Hypertext retrieval: follow human associative thinking to jump to documents containing related concepts/components.
11.3.2 Understanding and Evaluation
Component development process follows public standards.
11.3.3 Component Modification
Component functionality, behavior, and interface design made more abstract, general, parameterized.
11.3.4 Component Assembly
Three assembly modes:
Function-based assembly: assemble via subroutine calls and parameter passing.
Data-based assembly: data-oriented design method.
Object-oriented assembly: base class as parent, generate subclasses.
Component Assembly Mismatch Issues:
Mismatches caused by components.
Mismatches caused by connectors.
Mismatches due to conflicting global architectural assumptions among system elements.
11.4 Component Standards
CORBA, COM, EJB, etc.
12. Web Architecture Design
Evolution steps:
Monolithic application to separated database and web server
Application server clusters
Load balancing introduction (application-layer vs transport-layer, load balancing algorithms)
Stateful vs stateless services
Persistence technology ORM (object-relational mapping)
Database read-write separation
Caching to alleviate read pressure (Redis characteristics)
Content Delivery Network CDN (avoid bottlenecks for faster, stable content delivery)
Responsive web design (layout adapts to user behavior and device environment)
Business middle platform and data middle platform
Web system layering
References
Architecture Series: Software Engineering Basic Concepts (WeChat article)
System Architect Designer Tutorial, 2nd Edition
Software Architecture in Practice
For questions about attribution, corrections or content rights, please contactand we will review it promptly.