software architecture
DESCRIPTION
Advanced Software Engineering course (2014-2015) This lecture provides a more detailed explanation on what a Software Architecture isTRANSCRIPT
1
Advanced Software EngineeringURL: http://lore.com/Advanced-Software-Engineering-Univaq/
DISIMDep.nt of Information Engineering, Computer Science and MathematicsUniversity of L’Aquila, Italy
Software Architecture
Henry Muccini [email protected], @muccinihenry, henrymuccini.com
SEA GroupSEA Group
Copyright Notice
The material in these slides may be freely reproduced and distributed, partially or totally, as far as an explicit reference or acknowledge to the material author is preserved.
SEA GroupSEA Group
Software ArchitectureThe Software Architecture is the earliest model of the whole software system created along the software lifecycle
“Traditional” definition:→A set of components and connectors communicating through interfaces
“More Recent” understanding“Other facets”
→A set of architecture design decisions taken to generate the architecture artifact
→Focus on set of Views and Viewpoints, looking at stakeholders and their concern
SEA GroupSEA Group
«Traditional» definitions
SEA GroupSEA Group
Software Architecture definitionsPerry and Wolf, ’92 (aspects):
→“Architecture is concerned with the selection of architectural elements, their interactions, and the constraints on those elements and their interactions necessary to provide a framework in which to satisfy the requirements and serve as a basis for the design.”
→Elements are divided into processing elements, data elements and connection elements
Garlan and Shaw, ’93 (elements):→ Architecture for a specific system may be captured as “a collection of computational components - or simply components - together with a description of the interactions between these components - the connectors -”
Sommerville, 7th edition, ’04 (process):→ The design process for identifying the sub-systems making up a system and the framework for sub-system control and communication is architectural design. The output of this design process is a description of the SA.
SEA GroupSEA Group
In general terms…SA describes (in a more or less “formal” notation) how a system is structured into components and connectors…
→Components→Connectors→Channels and Ports
… and how these components interact→ Scenarios→State Diagrams→…
SA Structure (topology)
SA Dynamics (behavior)
SEA GroupSEA Group
Process (1)
Software SystemSoftware Architecture
Architecturalcomponents
CompositionRules
Constraints
RequirementsIdeal World Real World
Software SystemSoftware Architecture
SEA GroupSEA Group
Process (2)
Architectural constraints and requirements
Ideas
Constraints
Req1:..Req2:..Req3:..………
Architectural requirements
C2
C3C1
C4
Software Architecture
Software Architecture
synthesis
C2
C3C1
C4Software Architecture
prototypeEvaluation and Decisions making
SEA GroupSEA Group
STATIC DESCRIPTION
ComponentsConnectorsInterfaces
SEA GroupSEA Group
Components
A component is a building block that is …→A unit of computation or a data store, with an interface specifying the services it provides and requires→A unit of deployment→A unit of reuse
─ e.g., client, server, database, filters, ...
C1
S1S2S3
S’x
S’Y
provided services
required services
SEA GroupSEA Group
Component: ExampleSupply manager:
This module task is to automatically satisfy the request of supplies by the TLs,
it forwards the request of supplies to the military warehouse in order to automatically set up the shipping of supplies for whose that requested it.
It will not always send all the supplies requested since it depends on the warehouse resources availability and, more important, on the rules that has been set by the HQ user.
SEA GroupSEA Group
Components vs Objects
The level of abstraction is usually different
Size→Objects tend to be small→Components can be small (one object) or large (a library of objects or a complete application)
An architectural component may be implemented by several objects
Lifecycle →Objects are created and destroyed constantly→Components are created and destroyed infrequently
SEA GroupSEA Group
ConnectorsA connector is a building block that enables interaction among components
→Events→Client/server middleware→Messages and message buses→Shared variables→Procedure calls (local or remote)→Pipes
Connectors may be implicit or explicit→Connectors sometimes are just channels→Connectors sometimes have their own logic and complexity
Connectors may be endogenous or exogenous
SEA GroupSEA Group
Components and ConnectorsA component is (or should be) independent of the context in which it is used to provide services
A connector is (or should be) dependent on the context in which it is used to connect components
Connectors sometimes are modeled as special kinds of components
SEA GroupSEA Group
InterfacesAn interface is the external connection of a
component (or connector) that describes how to interact with it
Provided and required interfaces are importantSpectrum of interface specification
→ Loosely specified (events go in, events go out)→ API style (list of functions)→ Very highly specified (event protocols across the interface
in CSP)
SEA GroupSEA Group
Architecting: example
GUI
FeedServiceFeedServiceCommon
Action
NewsFeederAction
AdminAction
Factory
FeedDelegatePOJOs
NewsFeederDAO
FeedDAO
NewsFeederDAO
FeedDAO
FeedDelegate
TransferObject
ValidatorService
NewsFeederDelegatePOJOs
NewsFeederDelegate
Browser(html
javascript)
WebServices
DATABASE
TrasformationValidation
BusinessFactory
ValidationService
SEA GroupSEA Group
Architecting: example
GUI
FeedServiceFeedService
CommonAction
NewsFeederAction
AdminAction
Factory
FeedDelegatePOJOs
NewsFeederDAO
FeedDAO
NewsFeederDAO FeedDAO
FeedDelegate
Transfer Object
ValidatorService
NewsFeederDelegatePOJOs
NewsFeederDelegate
Browser(html
javascript)
Web Services
DATABASE
TrasformationValidation
BusinessFactory
ValidationService
BusinessExtensionIn
BusinessExtensionOut
PresentationExtensionOut
PresentationExtensionIn
SEA GroupSEA Group
Architectural Elements vs Design Elements
“Architecture is concerned with the selection of architectural elements, their interactions, and the constraints on those elements and their interactions necessary to provide a framework in which to satisfy the requirements and serve as a basis for the design.”
“Design is concerned with the modularization and detailed interfaces of the design elements, their algorithms and procedures, and the data types needed to support the architecture and to satisfy the requirements.”
(Perry & Wolf 92)
SEA GroupSEA Group
Architectural Elements vs Design Elements“The architecture of a software system defines that
system in terms of computational components and interactions among those components. … In addition to specifying the structure and topology of the system, the architecture shows the correspondence between the requirements and elements of the constructed system, thereby providing some rationale for the design decisions.”
(Shaw & Garlan 96)
SEA GroupSEA Group
DYNAMIC DESCRIPTION
Behavioral models
SEA GroupSEA Group
SA dynamics
The SA dynamics is expressed in terms of component interactions via connectors
• Labeled Transition Systems • Automata• UML StateCharts, Sequence Diagrams, Activity Diagrams• State Diagrams• Message Sequence Charts• …
SEA GroupSEA Group
Customer Interface
Customer Process
Web Server
Customer Server
Order Server
Cart Server
Catalog ServerDelivery Order
Process
SA Static Description
AN EXAMPLE : E-COMMERCE SYSTEM
SEA GroupSEA Group
SA Dynamic Description : Browse Catalogue Sequence Diagram
CustomerInterface
Registered Customer
CustomerProcess CatalogServer
Catalog DBInvolved
BrowseCatalog
BrowseCatalog
ReadStatus
Catalog Page
Output Page
Catalog Info
AN EXAMPLE : E-COMMERCE SYSTEM
SEA GroupSEA Group
CustomerInterface
Registered Customer
CustomerProcess CartServer
PlaceOrderReq
PlaceOrder
ReadStatus
Cart DBInvolved
pageOrderOutputPage
Order DBInvolved
OrderServer
EmptyCart
Cart DBInvolved
CustomerServer
ReadInfo
CustomerDB Involved
DeliveryOrderProcess
createNewOrder
OrderInfo
newOrder
CartInfo
CustomerInfo
OrderInfo
SA Dynamic Description : Place Order Sequence Diagram (success)
AN EXAMPLE : E-COMMERCE SYSTEM
SEA GroupSEA Group
SA Dynamic Description : Place Order Sequence Diagram (empty cart)
CustomerInterface
Registered Customer
CustomerProcess CartServer
PlaceOrderReq
PlaceOrder
ReadStatus
Cart DBInvolved
errorPageOutputPage
emptyCart
AN EXAMPLE : E-COMMERCE SYSTEM
SEA GroupSEA Group
MORE RECENT UNDERSTANDING
SEA GroupSEA Group
Architecture Is a Set of Software Structures
“The software architecture of a system is the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both.” [SAinPractice_book]
SEA GroupSEA Group
Architecture Is a Set of Software Structures
Three categories of structures:
1. Structure = implementation units = modules
2. Dynamic structures
3. mapping from software structures to the system’s organizational, developmental, installation, and execution environments.
implications
SEA GroupSEA Group
EXAMPLE (FOR DISCUSSION)
SEA GroupSEA Group
Application Example: Voting System
“We want to build a software system that allows people to vote electronically.
→ The citizen goes to the electoral place, and she votes using a hw/sw device.
→ The vote is stored locally and automatically sent to other computers.
→ The citizen identity must be validated by the system→ …”
SEA GroupSEA Group
Basic Requirement Example
The voting system must satisfy the following requirements:
→ One voter – one vote (no more than one vote for voter)→ The voter can vote in only one previous designated voting
place→ The voter must be identified by the election officials at the
voting place─ The citizen identity must be validated by the system
→ It is not possible to trace the votes back to the voters→ The election officials can’t read the results, guarantying that
the results are unknown until the end of the voting process
SEA GroupSEA Group
Example
Terminal
Activate