Compsci 331: Intro to Software Architecture PDF

Summary

These are lecture notes for Compsci 331, covering an introduction to software architecture. Topics include case studies like BusTracker, software architecture definitions, quality attributes, and examples of different architectures such as client-server and layered architectures. The notes also explore specifying quality requirements in software architecture.

Full Transcript

COMPSCI331: Large-Scale Software Development Week 7 Lecture 1: Introduction to Software Architecture Ewan Tempero School of Computer Science Week 7 Lecture 1: Introduction to Software Architecture – 1 / 29 ...

COMPSCI331: Large-Scale Software Development Week 7 Lecture 1: Introduction to Software Architecture Ewan Tempero School of Computer Science Week 7 Lecture 1: Introduction to Software Architecture – 1 / 29 Agenda Agenda Case Study: BusTracker Case Study References References Motivation 1 What is Architecture? Software Architecture Overview Definition Quality Attributes Reading: The Architecture of Open Source Applications, Volume II. Examples Scalable Web Architecture and Distributed Systems by Kate Matsudaira. Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 2 / 29 Case Study: BusTracker Agenda Case Study: BusTracker Series of videos (probably 5) going through the various aspects of References software architecture development Motivation 1 What is Architecture? Example is similar to the Auckland Transport Live Departures system Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 3 / 29 References Agenda Case Study: BusTracker Software Architecture in Practice Len Bass, Paul Clements, Rick References Kazman — 1st (1998), 2nd (2003), and 3rd (2013) editions 3rd edition Motivation 1 What is Architecture? available on-line through the library Definition Quality Attributes The architecture of open source applications Amy Brown & Greg Wilson Examples (editors), Volumes I & II http://aosabook.org (also available Quality & Architecture Key Points through library) Essential Software Architecture Ian Gorton (2006) available on-line through the library Software architecture : perspectives on an emerging discipline Mary Shaw, David Garlan (1996) Week 7 Lecture 1: Introduction to Software Architecture – 4 / 29 Motivation 1 Agenda Case Study: BusTracker Given a brief description of a system for providing a Concert Booking References Web Service, describe a “good enough” Software Architecture for it. Motivation 1 What is Architecture? Relevant questions: Definition Quality Attributes ◦ What is a software architecture? Examples Quality & Architecture ◦ How do we describe a software architecture? Key Points ◦ How do we know it is good enough? (Answer: It has the required quality attributes) ◦ What are qualitas attributes? ◦ How do we demontrate that a given software architecture has specific quality attributes? Week 7 Lecture 1: Introduction to Software Architecture – 5 / 29 Motivation 2 Agenda Case Study: BusTracker You are about to start building a system for managing pay-as-you-park References solutions (e.g. a competitor to ParkMate) It has to provide real-time Motivation 1 What is Architecture? tracking of which parking spaces are available or occupied to a central Definition Quality Attributes control centre, which will provide monitoring of facilities for Operations, Examples and provide those want to park their vehicles information as to where Quality & Architecture Key Points parks are available and to support payment. Questions: ◦ Should it be a web service? Or only a web service? Or a web service based on containers? Will a web service be fast enough (and how fast does it need to be?) How do we ensure reliability and security? ◦ We have a team of 20 developers. We want to maximise their productivity. How do we organise the code to achieve this? ◦ Due to power and air conditioning requirements we can only use small servers but we can afford a lot of them. How do we design the system to maximise their use? ◦ How synchronous should the communication be? Week 7 Lecture 1: Introduction to Software Architecture – 6 / 29 One of these is not like the others Agenda Case Study: BusTracker Show picture of 4 bridges. References Motivation 1 What is Architecture? Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 7 / 29 Definitions of Software Architecture Agenda There are lots —http://www.sei.cmu.edu/architecture/definitions.html Case Study: BusTracker used to have over 100 References Motivation 1 The structure of the components of a program/system, their interrelationships, What is Architecture? Definition and principles and guidelines governing their design and evolution over time. Quality Attributes (Garlan and Perry, Guest editorial, IEEE Transactions on Software Engineering, Examples Quality & Architecture April 1995) Key Points An architecture is the set of significant decisions about the organization of a software system, the selection of the structural elements and their interfaces by which the system is composed, together with their behavior as specified in the collaborations among those elements, the composition of these structural and behavioral elements into progressively larger subsystems, and the architectural style that guides this organization—these elements and their interfaces, their collaborations, and their composition (Booch, Rumbaugh, and Jacobson, The UML Modeling Language User Guide, 1999). The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them. (Bass, Clements, Kazman Software Architecture in Practice Week 7 Lecture 1: Introduction to Software Architecture – 8 / 29 Other phrases Agenda Case Study: BusTracker “large scale components” References “system level abstraction” Motivation 1 What is Architecture? “components and interaction between components” Definition Quality Attributes “system level analysis” Examples “load-bearing walls” Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 9 / 29 Why Software Architecture? Agenda Case Study: BusTracker systems are getting bigger and more complicated References Motivation 1 ⇒ need “standard” solutions to common problem types — reuse What is Architecture? ⇒ need some way to talk about them — understanding, Definition Quality Attributes communication Examples Quality & Architecture ⇒ need some way to organise them — construction, evolution Key Points ⇒ need some way to reason about them — analysis, management ⇒ large scale decisions are more important (from a total system cost viewpoint) than data structures and algorithms Week 7 Lecture 1: Introduction to Software Architecture – 10 / 29 In the Software Lifecycle Agenda Case Study: BusTracker Requirements References Specification Motivation 1 What is Architecture? Architecture Definition Quality Attributes Detailed Design Examples Implementation Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 11 / 29 Software Architecture Topics Agenda Case Study: BusTracker Classification How do we organise architectures? What kinds (or “styles”) References or architectures are there? How do we describe an architecture? Motivation 1 What is Architecture? Analysis: Given an architecture, how do we reason about it? What do we Definition Quality Attributes need to know about it to reason effectively? Examples Develop: How do we decide on an architecture for a system? How do we Quality & Architecture Key Points create a new architecture? What issues to we have to keep in mind? Documentation: How should architectures be described? What are the important things to show? Week 7 Lecture 1: Introduction to Software Architecture – 12 / 29 What Software Architecture is Not Agenda Case Study: BusTracker Software Architecture is not System (or Computer) Architecture References Software Architecture is not about functionality Motivation 1 What is Architecture? Software Architecture is not a box-and-line drawing Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 13 / 29 What Software Architecture is Not Agenda Case Study: BusTracker Software Architecture is not System (or Computer) Architecture References Software Architecture is not about functionality Motivation 1 What is Architecture? Software Architecture is not a box-and-line drawing Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 13 / 29 What is Software Architecture? Agenda Case Study: BusTracker The software architecture of a program or computing system References Motivation 1 is the structure or structures of the system, which comprise What is Architecture? software elements, the externally visible properties of those Definition Quality Attributes elements, and the relationships among them. (Bass, Examples Quality & Architecture Clements, Kazman Software Architecture in Practice) Key Points Week 7 Lecture 1: Introduction to Software Architecture – 14 / 29 What is Software Architecture? Agenda Case Study: BusTracker The software architecture of a program or computing system References Motivation 1 is the structure or structures of the system, which comprise What is Architecture? software elements, the externally visible properties of those Definition Quality Attributes elements, and the relationships among them. (Bass, Examples Quality & Architecture Clements, Kazman Software Architecture in Practice) Key Points multiple structures software elements and relationships externally visible properties Week 7 Lecture 1: Introduction to Software Architecture – 14 / 29 Describing Architectures Agenda Case Study: BusTracker An architecture rarely can be fully understood by just looking at one References picture Motivation 1 What is Architecture? The architecture for a system of a reasonable size will typically consist of Definition Quality Attributes multiple structures Examples Different structures provide different information about the architecture, Quality & Architecture Key Points and so help answer different kinds of questions Different structures may have different kinds of software elements and/or relationships To describe a structure, we must provide one or more views of it A view must describe the relevant software elements and their relationships Week 7 Lecture 1: Introduction to Software Architecture – 15 / 29 Good & Bad Architectures Agenda Case Study: BusTracker An architecture is not inherently “good” or “bad” References The only criteria of relevance is “meets quality requirements” or “has the Motivation 1 What is Architecture? required quality attributes” Definition Quality Attributes Quality is not absolute. It can only be measured relative to what criteria Examples are considered important Quality & Architecture Key Points ◦ “I don’t care if it blue-screens once a day so long as it is cheap/the same as everyone else uses/accessible to me” ◦ “I don’t care if it’s free, I want someone else to install/maintain/fix it (cheaply)” ◦ “I have particular requirements so I need to be able to change the code myself” Week 7 Lecture 1: Introduction to Software Architecture – 16 / 29 Quality Attributes relevant to SA Agenda Case Study: BusTracker Extensibility References Motivation 1 Performance What is Architecture? Definition Security Quality Attributes Examples Understandability Quality & Architecture Readability Key Points Comprehensibility Modifiability Maintainability Portability Buildability Scaleability Availability Reliability... Week 7 Lecture 1: Introduction to Software Architecture – 17 / 29 Properties of software Agenda Case Study: BusTracker Which is more important? References Motivation 1 ◦ Getting the system built quickly (buildability) What is Architecture? ◦ Making changes to it cost effectively, whether to fix faults or to cope Definition Quality Attributes with changing conditions (modifiability or maintainability) Examples Quality & Architecture ◦ Making changes to it to add new functionality cost effectively Key Points (extensibility) ◦ Be able to move systems onto different hardware and/or operating systems (portability) ◦ Having developers new to the project be able to understand it quickly enough to be able to be useful (understandability, readability, comprehensibility) Week 7 Lecture 1: Introduction to Software Architecture – 18 / 29 Client-Server Agenda Case Study: BusTracker “seminal architectural model which remains the most widely adopted” References What makes something “Client-Server”? Motivation 1 What is Architecture? When should we use Client-Server? Definition Quality Attributes When should we not use Client-Server? Examples Is Client-Server necessary and sufficient for : Quality & Architecture Key Points ◦ Git ◦ Canvas ◦ Google ◦ Amazon ◦ Excel ◦ SPSS (statistics) ? Week 7 Lecture 1: Introduction to Software Architecture – 19 / 29 Client-Server: Relevant Quality Attributes Agenda Case Study: BusTracker Extensibility — Only the server needs to change References Motivation 1 Performance — Add more servers What is Architecture? Definition Security — communications channel is a weak link Quality Attributes Examples Understandability, Readability, Comprehensibility — Can deal with client Quality & Architecture (UI only) separately from server (no UI), added complication of protocol Key Points between client and server Modifiability — can change client and server independently Maintainability — faults in client won’t affect server (?) Portability — change change client and server hardware independently Buildability — More work to do Scaleability — More clients can be added Availability — System can be unavailable even though the client (server) is still working (because the server (client) is not) Reliability — More things to fail... Week 7 Lecture 1: Introduction to Software Architecture – 20 / 29 Layers Agenda Case Study: BusTracker a layer encapsulates everything below it References Motivation 1 Application Application What is Architecture? Definition Presentation Quality Attributes Presentation Examples Quality & Architecture Key Points Session Session Transport Transport Network Network Data Link Data Link Physical Physical MEDIA Week 7 Lecture 1: Introduction to Software Architecture – 21 / 29 Layers Agenda Case Study: BusTracker References Motivation 1 What is Architecture? Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 22 / 29 Quality Attributes relevant to Layers Agenda Case Study: BusTracker Performance — more layers ⇒ slower References Buildability/Modifiability/Understandability/... — only need to deal with Motivation 1 What is Architecture? one layer at a time Definition Quality Attributes Portability — only the lower layer(s) need to change Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 23 / 29 Replication Agenda Case Study: BusTracker References Motivation 1 What is Architecture? Definition Server Server Replica Replica Quality Attributes Examples Client Client Quality & Architecture Key Points Server Server Replica Replica Client Client Server Server Replica Replica Under which circumstances should different forms be used? Week 7 Lecture 1: Introduction to Software Architecture – 24 / 29 Quality Attributes relevant to Replication Agenda Case Study: BusTracker Availability, Performance (Latency) — broadcast style increases by References reducing effect of server failures, and not having to wait for the slowest Motivation 1 What is Architecture? server, but broadcast in general does not scale Definition Quality Attributes Performance (throughput) — having a single server process a client Examples Quality & Architecture request means more requests can be processed simultaneously, Key Points increasing throughput (but reducing latency and availability) Scaleability — can add as many servers as are needed (sometimes at the cost of performance) Week 7 Lecture 1: Introduction to Software Architecture – 25 / 29 Describing the “code” Agenda Case Study: BusTracker References Motivation 1 HTTP Client HTTP Server What is Architecture? Definition Quality Attributes Presentation Access Logging Access Examples Manager Control Control Quality & Architecture Key Points UI Cache Stream Request Manager Manager Manager Analysis Protocol Stream Path Manager Manager Resolver Decompose along functional lines into modules Different modules get deployed in different places Week 7 Lecture 1: Introduction to Software Architecture – 26 / 29 HTTP Client Architecture Agenda Case Study: BusTracker ECMA script References User Interface User Management Motivation 1 Java Interface What is Architecture? Definition XML HTML Quality Attributes Image Rendering Cache management Examples Request management Document Parser Layout Style sheet Quality & Architecture Security management Key Points Font library Network Interface Platform specifics systems have subsystems subsystems have architecture Week 7 Lecture 1: Introduction to Software Architecture – 27 / 29 Specifying Quality Agenda Case Study: BusTracker software architecture depends on quality attribute requirements References how do we specify these requirements so that we can determine if a Motivation 1 What is Architecture? given software architecture meets them? Definition Quality Attributes Examples Quality & Architecture Key Points Week 7 Lecture 1: Introduction to Software Architecture – 28 / 29 Key Points Agenda Case Study: BusTracker The software architecture of a system is the “large-scale” view of its References design, showing the “important” design decisions Motivation 1 What is Architecture? The choice of architecture for a system depends on the quality attributes Definition Quality Attributes the system must meet, not the functionality Examples Understanding software architecture concepts helps inform what Quality & Architecture Key Points questions to ask Week 7 Lecture 1: Introduction to Software Architecture – 29 / 29