Software Engineering Architectural Design PDF
Document Details
Ian Sommerville
Tags
Summary
This document covers software architectural design, including aspects like layered architectures, the model-view-controller (MVC) pattern, and client-server architectures. It highlights the importance of design choices in performance, security, and maintainability, emphasizing a practical approach to software design.
Full Transcript
CS281 - Software Engineering Architectural Design 1 Architectural Design Overview Architectural design decisions Architectural views Architectural patterns Application architectures Source: SE9 by Ian Chapter 6 Architectural design...
CS281 - Software Engineering Architectural Design 1 Architectural Design Overview Architectural design decisions Architectural views Architectural patterns Application architectures Source: SE9 by Ian Chapter 6 Architectural design 2 Sommerville Architectural Design It is the critical link between design and requirements engineering. Architectural design is concerned with understanding how a system should be organized and designing the overall structure of that system. i.e. It involves identifying major system components and their communications. The output of this design process is an architectural model, a description of the software architecture. Often carried out in parallel with some specification activities. Source: SE9 by Ian Chapter 6 Architectural design 3 Sommerville Importance of Software Architecture It affects the performance, robustness, distributability and maintainability of a system. Three advantages of explicitly designing and documenting S/W Architecture: 1. Stakeholder communication: Architecture may be used as a focus of discussion by system stakeholders. 2. System analysis: Means that analysis of whether the system can meet its non-functional requirements is possible. 3. Large-scale reuse: The architecture may be reusable across a range of systems. Product-line architectures may be developed. Source: SE9 by Ian Chapter 6 Architectural design 4 Sommerville Levels of Abstraction You can design s/w architectures at two levels of abstraction: 1. Architecture in the small: is concerned with the architecture of individual programs. At this level, we are concerned with the way that an individual program is decomposed into components. Source: SE9 by Ian Chapter 6 Architectural design 5 Sommerville Levels of Abstraction – Cont. 2. Architecture in the large: is concerned with the architecture of complex enterprise systems that include other systems, programs, and program components. These enterprise systems are distributed over different computers, which may be owned and managed by different companies. Source: SE9 by Ian Chapter 6 Architectural design 6 Sommerville Architectural Representations: Block diagrams Simple, informal, show entities and relationships. The most frequently used method for documenting S/W architectures. They are useful for communication with stakeholders and for project planning Very abstract as they do not show the nature of component relationships nor the externally visible properties of the sub-systems. They lack semantics, do not show the types of relationships between entities nor the visible properties of entities in the architecture. Source: SE9 by Ian Chapter 6 Architectural design 7 Sommerville There are two ways to use of Architectural Models.. 1. To facilitate discussion about the system design: A high-level architectural view of a system is useful for communication with system stakeholders and project planning because it is not cluttered with detail. Stakeholders can relate to it and understand an abstract view of the system. They can then discuss the system as a whole without being confused by detail. 2. To document an architecture that has been designed: The aim here is to produce a complete system model that shows the different components in a system, their interfaces and their connections. Source: SE9 by Ian Chapter 6 Architectural design 8 Sommerville Example: System Architecture Source: SE9 by Ian Chapter 6 Architectural design 9 Sommerville Architectural Design Overview Architectural design decisions Architectural views Architectural patterns Application architectures Source: SE9 by Ian Chapter 6 Architectural design 10 Sommerville Architectural Design Decisions Architectural design is a creative process so the process differs depending on the type of system being developed. However, a number of common decisions span all design processes and these decisions affect the non-functional characteristics of the system. Q Is there a generic application architecture that can act as a template? Q How will the system be distributed? See slide 34 Q What architectural styles are appropriate? Q What control strategy should be used? Central? Event-based? Q How will the architectural design be evaluated? Q ……. Source: SE9 by Ian Chapter 6 Architectural design 11 Sommerville Architectural Design Decisions – Cont. Architecture reuse Systems in the same domain often have similar architectures that reflect domain concepts. Application product lines are built around a core architecture with variants that satisfy particular customer requirements. The architecture of a system may be designed around one of more architectural patterns or ‘styles’. These capture the essence of an architecture and can be instantiated in different ways. Discussed later in this chapter. Source: SE9 by Ian Chapter 6 Architectural design 12 Sommerville Architectural Design Decisions – Cont. System Characteristics (Non-functional Requirements) Performance: Localize critical operations and minimize communications. Use large rather than fine-grain components. Security: Use a layered architecture with critical assets in the inner layers. Safety: Localize safety-critical features in a small number of sub- systems. Availability: Include redundant components and mechanisms for fault tolerance. Maintainability: Use fine-grain, replaceable components. There is a potential conflict between some of these architectures!! Source: SE9 by Ian Chapter 6 Architectural design 13 Sommerville Example: Layered Architecture Source: SE9 by Ian Chapter 6 Architectural design 14 Sommerville Architectural Design Overview Architectural design decisions Architectural views Architectural patterns Application architectures Source: SE9 by Ian Chapter 6 Architectural design 15 Sommerville Architectural Views You usually need to present multiple views of the software architecture. Each architectural model only shows one view or perspective of the system. For instance: How a system is decomposed into modules How the run-time processes interact The different ways in which system components are distributed across a network. …….. Q) What views are required? A) Different opinions! Source: SE9 by Ian Chapter 6 Architectural design 16 Sommerville Architectural Views – Cont. Krutchen suggested: 4 + 1 View Model Of Software Architecture Logical view: shows the key abstractions in the Developm system as objects or object classes. It considers the Logical functional requirements- What the system should ent view provide in terms of services to its users. scenari view Development view: shows how the software is os decomposed for development. Process Physical Process view: shows how, at run-time, the system view view is composed of interacting processes. It considers Non-functional requirements (concurrency, performance, scalability,…etc.) Physical view: shows how the system hardware and software components are distributed across the processors in the system. Use cases or scenarios (+1): to describe the behavior of the system as seen by its end users, analysts, and testers Source: SE9 by Ian Chapter 6 Architectural design 17 Sommerville Logical or Layered View vs. Physical View Source: SE9 by Ian Chapter 6 Architectural design 18 Sommerville Architectural Design Overview Architectural design decisions Architectural views Architectural patterns 1. MVC 2. Layered 3. Client-server 4. Repository 5. Pipe and filter Application architectures Source: SE9 by Ian Chapter 6 Architectural design 19 Sommerville Design Pattern In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Design patterns are tools. Source: SE9 by Ian Chapter 6 Architectural design 20 Sommerville Architectural Patterns The Beginning - “Gang of four” (Gama et al 1995) Patterns are a means of representing, sharing and reusing knowledge. Patterns may be represented using tabular and graphical descriptions. An architectural pattern is a stylized description of good design practice, which has been tried and tested in different environments. Source: SE9 by Ian Chapter 6 Architectural design 21 Sommerville 1. The Model-view-controller Pattern A design pattern that separates the business logic from the graphical user interface. Model: The application object View: Its screen presentation Controller: defines the way the user interface reacts to user input _____________________________________________________________________________________ E. Gamma; R. Helm; R. Johnson; J. Vlissides, 1994, Design Patterns: Elements of Reusable Object- Oriented Software, Addison-Wesley Professional. Source: SE9 by Ian Sommerville 1. The Model-View-Controller (MVC) Pattern - Cont. Name MVC (Model-View-Controller) Description Separates presentation and interaction from the system data. The system is structured into three logical components that interact with each other. The Model component manages the system data and associated operations on that data. The View component defines and manages how the data is presented to the user. The Controller component manages user interaction (e.g., mouse clicks, etc.) and passes these interactions to the View and the Model. See Figure 6.3. When used Used when there are multiple ways to view and interact with data. Also used when the future requirements for interaction and presentation of data are unknown. Advantages Allows the data to change independently of its representation and vice versa. Supports presentation of the same data in different ways with changes made in one representation shown in all of them. Disadvantages Can involve additional code and code complexity when the data model and interactions are simple. Source: SE9 by Ian Chapter 6 Architectural design 23 Sommerville 1. The Model-view-controller Pattern – Cont. Examples for variations... Example: Web Application Architecture Using The MVC Pattern Source: SE9 by Ian Chapter 6 Architectural design 24 Sommerville 2. The Layered Architecture Pattern Organises the system into a set of layers each of which provide a set of services. Used to model the interfacing of sub-systems. When a layer interface changes, only the adjacent layer is affected. Number of layers is arbitrary. Supports the incremental development of sub-systems in different layers. However, often artificial to structure systems in this way. Source: SE9 by Ian Chapter 6 Architectural design 25 Sommerville 2. The Layered Architecture Pattern – Cont. Example: The architecture of a library system (LIBSYS) Source: SE9 by Ian Chapter 6 Architectural design 26 Sommerville 3. The Client-server Architecture Pattern A distributed system model which shows how data and processing is distributed across a range of components. Can be implemented on a single computer. Set of stand-alone servers which provide specific services such as printing, data management, etc. Set of clients which call on these services. Network which allows clients to access servers. Source: SE9 by Ian Chapter 6 Architectural design 27 Sommerville 4. The Repository Pattern When Sub-systems/components must exchange data, this may be done in two ways: 1. Each sub-system maintains its own database and passes data explicitly to other sub-systems. 2. Shared data is held in a central database or repository and may be accessed by all sub-systems. When large amounts of data are to be shared, the repository model of sharing is most commonly used a this is an efficient data sharing mechanism. Source: SE9 by Ian Chapter 6 Architectural design 28 Sommerville 4. The Repository Pattern – Cont. Example: A repository architecture for an IDE Source: SE9 by Ian Chapter 6 Architectural design 29 Sommerville 4. The Repository Pattern – Cont. Name Repository Description All data in a system is managed in a central repository that is accessible to all system components. Components do not interact directly, only through the repository. When used You should use this pattern when you have a system in which large volumes of information are generated that has to be stored for a long time. You may also use it in data-driven systems where the inclusion of data in the repository triggers an action or tool. Advantages Components can be independent—they do not need to know of the existence of other components. Changes made by one component can be propagated to all components. All data can be managed consistently (e.g., backups done at the same time) as it is all in one place. Disadvantages The repository is a single point of failure so problems in the repository affect the whole system. May be inefficiencies in organizing all communication through the repository. Distributing the repository across several computers may be difficult. Source: SE9 by Ian Chapter 6 Architectural design 30 Sommerville 5. The Pipe and Filter Architecture Pattern Functional transformations process their inputs to produce outputs. Variants of this approach are very common. When transformations are sequential, this is a batch sequential model which is extensively used in data processing systems. Not really suitable for interactive systems. Example: batch processing application Source: SE9 by Ian Chapter 6 Architectural design 31 Sommerville 5. The Pipe and Filter Architecture Pattern – Cont. Name Pipe and filter Description The processing of the data in a system is organized so that each processing component (filter) is discrete and carries out one type of data transformation. The data flows (as in a pipe) from one component to another for processing. When used Commonly used in data processing applications (both batch- and transaction-based) where inputs are processed in separate stages to generate related outputs. Advantages Easy to understand and supports transformation reuse. Workflow style matches the structure of many business processes. Evolution by adding transformations is straightforward. Can be implemented as either a sequential or concurrent system. Disadvantages The format for data transfer has to be agreed upon between communicating transformations. Each transformation must parse its input and unparse its output to the agreed form. This increases system overhead and may mean that it is impossible to reuse functional transformations that use incompatible data structures. Source: SE9 by Ian Chapter 6 Architectural design 32 Sommerville Architectural Design Overview Architectural design decisions Architectural views Architectural patterns 1. MVC 2. Layered 3. Repository 4. Client-server 5. Pipe and filter Application architectures Source: SE9 by Ian Chapter 6 Architectural design 33 Sommerville Application architectures Businesses operating in the same sector use common sector specific applications. The application systems tend to have a common architecture that reflects the application requirements. Application architectures encapsulate the principal characteristics of a class of systems. For example: in real-time systems, there might be generic architectural models of different system types, such as data collection systems or monitoring systems. Instances of these systems differ in detail, but the common architectural structure can be reused when developing new systems of the same type. Source: SE9 by Ian Chapter 6 Architectural design 34 Sommerville Application architectures – Cont. Generic Application Architectures A generic application architecture is an architecture for a type of software system that may be configured and adapted to create a system that meets specific requirements. The application architecture may be re- implemented when developing new systems but, for many business systems, application reuse is possible without reimplementation. For example: the Enterprise Resource Planning (ERP) systems from companies such as SAP and Oracle. In these systems, a generic system is configured and adapted to create a specific business application. Source: SE9 by Ian Chapter 6 Architectural design 35 Sommerville As a Software Designer… An excerpt from Sommerville’s book (Page 165) Source: SE9 by Ian Chapter 6 Architectural design 36 Sommerville Examples Of Application Systems Transaction processing applications Such as e-commerce systems and reservation systems are data-centered applications that process user requests and update information in a system database. Language processing systems Such as compilers and command interpreters are applications where the users’ intentions are specified in a formal language that is processed and interpreted by the system. Source: SE9 by Ian Chapter 6 Architectural design 37 Sommerville Transaction Processing Systems Process user requests for information from a database or requests to update the database. From a user perspective a transaction is any coherent sequence of operations that satisfies a goal. Users make asynchronous requests for service which are then processed by a transaction manager. The conceptual architectural structure of TP applications: Source: SE9 by Ian Sommerville Chapter 6 Architectural design 38 Transaction Processing Systems – Cont. Example: The software architecture of an ATM system Source: SE9 by Ian Chapter 6 Architectural design 39 Sommerville Transaction Processing Systems – Cont. Information System Architecture All systems that involve interaction with a shared database can be considered to be transaction-based information systems. Information systems have a generic architecture that can be organized as a layered architecture, where the layers include: § The user interface § User communications § Information retrieval § System database Source: SE9 by Ian Chapter 6 Architectural design 40 Sommerville Questions? Source: SE9 by Ian Chapter 1 Introduction 41 Sommerville