Architectural Design PDF Lecture Notes
Document Details
Uploaded by GreatestCubism1128
null
Dr. Noha Adly
Tags
Summary
These lecture notes cover architectural design, a crucial aspect of software engineering. They discuss the importance of understanding the structure and organization of software systems, emphasizing the connections between design and requirements. They also touch upon agile development methodologies, which emphasize iterative system development and architecture.
Full Transcript
12/6/2021 Architectural design Architectural design is concerned with understanding how a Architectural Design...
12/6/2021 Architectural design Architectural design is concerned with understanding how a Architectural Design software system should be organized and designing the overall structure of that system. Architectural design is the critical link between design and requirements engineering, as it identifies the main structural Architectural design decisions components in a system and the relationships between them. Architectural views Often carried out in parallel with some specification activities. Architectural patterns The output of the architectural design process is an Application architectures architectural model that describes how the system is organized as a set of communicating components. Dr. Noha Adly CSE 322 - Architectural Design 1 Dr. Noha Adly CSE 322 - Architectural Design 2 1 2 Agility and architecture The architecture of a packing robot control system It is generally accepted that an early stage of agile processes is to design an overall systems architecture. Incremental development of architectures is not usually successful. Refactoring the system architecture is usually expensive because it affects so many components in the system Dr. Noha Adly CSE 322 - Architectural Design 3 Dr. Noha Adly CSE 322 - Architectural Design 4 3 4 12/6/2021 Architectural abstraction Advantages of explicit architecture There is a significant overlap between the processes of Stakeholder communication requirements engineering and architectural design Architecture is a high level presentation of the system may be used as a focus of discussion by system stakeholders. Non-functional requirements has the most significant effect on system’s architecture System analysis Means that analysis of whether the system can meet its non- You can design software architectures at two levels of functional requirements is possible. abstraction Architectural design decisions have a profound effect on whether or not the system can meet critical requirements such as Architecture in the small is concerned with the architecture of performance, reliability, and maintainability individual programs. At this level, we are concerned with the way that an individual program is decomposed into components. Large-scale reuse Architecture in the large is concerned with the architecture of A model of a system architecture is a compact description of complex enterprise systems that include other systems, system organization and how the components interoperate programs, and program components. These enterprise systems The architecture is often the same for large systems with similar are distributed over different computers, which may be owned requirements and may be reusable across a range of systems and managed by different companies. Dr. Noha Adly CSE 322 - Architectural Design 5 Dr. Noha Adly CSE 322 - Architectural Design 6 5 6 Architectural representations Use of architectural models Simple, informal block diagrams showing entities and relationships As a way of facilitating discussion about the system are the most frequently used method for documenting software design architectures. A high-level architectural view of a system is useful for Each box in the diagram represents a component. communication with system stakeholders and project planning Boxes within boxes indicate that the component has been decomposed because it is not cluttered with detail. Stakeholders can relate to to sub-components. it and understand an abstract view of the system. They can then Arrows mean that data and or control signals are passed from discuss the system as a whole without being confused by detail. component to another. Box and line diagrams are sufficient But these have been criticised because they lack semantics do not show the types of relationships between entities As a way of documenting an architecture that has been nor the visible properties of entities in the architecture. designed However, box and line diagrams are useful for communication with The aim here is to produce a complete system model that shows stakeholders and for project planning. the different components in a system, their interfaces and their connections. The requirements for model semantics depends on how the models Architectural description languages may be used are used. Dr. Noha Adly CSE 322 - Architectural Design 7 Dr. Noha Adly CSE 322 - Architectural Design 8 7 8 12/6/2021 Architectural design decisions Architectural design is a creative process where you design a system organization that will satisfy the functional and non functional requirements There is no formulaic architectural design process Architectural design decisions The process differs depending on The type of system being developed The background and experience of the system architect The specific requirements for the systems It is therefore useful to think of architectural design as a series of decisions to be made rather than a sequence of activities A number of common structural decisions profoundly affect the system and its development process Dr. Noha Adly CSE 322 - Architectural Design 9 Dr. Noha Adly CSE 322 - Architectural Design 10 9 10 Architectural design decisions 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. An architectural pattern is a description of a system organization such as client-server organization or layered architecture Dr. Noha Adly CSE 322 - Architectural Design 11 Dr. Noha Adly CSE 322 - Architectural Design 12 11 12 12/6/2021 Architecture and system characteristics Performance Localize critical operations and minimize communications. Use large rather than fine-grain components. Replicate the system and execute it on different processors Security Architectural views Use a layered architecture with critical assets in the inner layers. Safety Localise 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. Dr. Noha Adly CSE 322 - Architectural Design 13 Dr. Noha Adly CSE 322 - Architectural Design 14 13 14 Architectural views Architectural views What views or perspectives are useful when designing and documenting a system’s architecture? What notations should be used for describing architectural models? Each architectural model only shows one view or perspective of the system. It might show how a system is decomposed into modules, how the run-time processes interact or the different ways in which system components are distributed across a network. For both design and documentation, you usually need to present multiple views of the software architecture. Dr. Noha Adly CSE 322 - Architectural Design 15 Dr. Noha Adly CSE 322 - Architectural Design 16 15 16 12/6/2021 The logical view of the architecture of a packing 4 + 1 view model of software architecture robot control system A logical view, which shows the key abstractions in the system as objects or Developed during the object classes. design process. It should be possible to relate the system requirements to entities in this logical view. They are a way of communicating the A process view, which shows how, at run-time, the system is composed of essence of a system to interacting processes. different stakeholders. This view is useful for making judgments about nonfunctional system characteristics such as performance and availability. During the design process, some of the other views A development view, which shows how the software is decomposed for may also be developed development. when different aspects of This view is useful for software managers and programmers the system are discussed A physical view, which shows the system hardware and how software It may also be possible to components are distributed across the processors in the system. associate architectural This view is useful for systems engineers planning a system deployment. patterns, with the different Related using use cases or scenarios (+1) views of a system. Dr. Noha Adly CSE 322 - Architectural Design 17 Dr. Noha Adly CSE 322 - Architectural Design 19 17 19 Representing architectural views Some people argue that the UML is an appropriate notation for describing and documenting system architectures UML does not include abstractions appropriate for high- level system description. Architectural patterns Informal notations might be more useful in the design process while UML is suitable for documenting an architecture in details Architectural description languages (ADLs) have been developed but are not widely used Dr. Noha Adly CSE 322 - Architectural Design 20 Dr. Noha Adly CSE 322 - Architectural Design 21 20 21 12/6/2021 Architectural patterns The Model-View-Controller (MVC) pattern Name MVC (Model-View-Controller) Patterns are a means of representing, sharing and reusing knowledge. Description Separates presentation and interaction from the system data. The system is structured into three logical components that interact with An architectural pattern is a stylized description of good each other. The Model component manages the system data and associated operations on that data. The View component defines design practice, which has been tried and tested in and manages how the data is presented to the user. The Controller different environments. component manages user interaction (e.g., key presses, mouse clicks, etc.) and passes these interactions to the View and the Model. See Figure 6.3. Patterns should include information about when they are Example Figure 6.4 shows the architecture of a web-based application useful and when they are not useful. system organized using the MVC pattern. When used Used when there are multiple ways to view and interact with data. Patterns may be represented using tabular and graphical Also used when the future requirements for interaction and descriptions. 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. Dr. Noha Adly CSE 322 - Architectural Design 22 Dr. Noha Adly CSE 322 - Architectural Design 23 22 23 The organization of the Model-View-Controller – Web application architecture using the MVC pattern a conceptual view Dr. Noha Adly CSE 322 - Architectural Design 24 Dr. Noha Adly CSE 322 - Architectural Design 25 24 25 12/6/2021 Layered architecture A generic layered architecture Used to model the interfacing of sub-systems. Organises the system into a set of layers each of which provide a set of services. Each layer only relies on the facilities and services offered by the layer immediately beneath it. Supports the notions of separation and independence which are fundamental to architectural design because they allow changes to be localized Supports the incremental development of sub-systems in different layers: As a layer is developed, some of the services provided by that layer may be made available to users. Supports changeability and portability: When a layer interface changes, only the adjacent layer is affected. Dr. Noha Adly CSE 322 - Architectural Design 26 Dr. Noha Adly CSE 322 - Architectural Design 27 26 27 The Layered architecture pattern The architecture of the iLearn system Name Layered architecture Description Organizes the system into layers with related functionality associated with each layer. A layer provides services to the layer above it so the lowest-level layers represent core services that are likely to be used throughout the system. Example A layered model of a iLearn system. When used Used when building new facilities on top of existing systems; when the development is spread across several teams with each team responsibility for a layer of functionality; when there is a requirement for multi-level security. Advantages Allows replacement of entire layers so long as the interface is maintained. Redundant facilities (e.g., authentication) can be provided in each layer to increase the dependability of the system. Disadvantages In practice, providing a clean separation between layers is often difficult and a high-level layer may have to interact directly with lower-level layers rather than through the layer immediately below it. Performance can be a problem because of multiple levels of interpretation of a service request as it is processed at each layer. Dr. Noha Adly CSE 322 - Architectural Design 28 Dr. Noha Adly CSE 322 - Architectural Design 29 28 29 12/6/2021 Repository architecture The Repository pattern Name Repository MVC and layered architecture patterns presents Description All data in a system is managed in a central repository that is conceptual view of a system accessible to all system components. Components do not interact directly, only through the repository. Repository architecture is a pattern describing how a set Example Figure 6.9 is an example of an IDE where the components use a of interacting components can share data repository of system design information. Each software tool generates information which is then available for use by other tools. Sub-systems must exchange data. This may be done in When used You should use this pattern when you have a system in which large two ways: 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 Shared data is held in a central database or repository and may inclusion of data in the repository triggers an action or tool. be accessed by all sub-systems; Advantages Components can be independent—they do not need to know of the Each sub-system maintains its own database and passes data existence of other components. Changes made by one component explicitly to other sub-systems. 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 When large amounts of data are to be shared, the place. repository model of sharing is most commonly used as Disadvantages The repository is a single point of failure so problems in the repository affect the whole system. May be inefficiencies in this is an efficient data sharing mechanism. organizing all communication through the repository. Distributing the repository across several computers may be difficult. Dr. Noha Adly CSE 322 - Architectural Design 30 Dr. Noha Adly CSE 322 - Architectural Design 31 30 31 A repository architecture for an IDE Client-server architecture The Repository pattern is concerned with the static structure of a system and does not show its run-time organization. Client-server pattern is a run-time organization for distributed systems It is organized as a set of services and associated servers, and clients that access and use the services. The major components: A set of servers that offer services to other components. Examples of servers include print servers offering printing services, file servers, compile server offering programming language compilation services A set of clients that call on the services offered by servers. There will normally be several instances of a client program executing concurrently on different computers. Example: version-controlled environment that keeps track of changes to software and A network that allows the clients to access these services. allows rollback to earlier versions. The repository is passive and control is the responsibility of the components using the Most client–server systems are implemented as distributed systems, repository. connected using Internet protocols. but the logical model of independent services running on separate servers can be implemented on a single Dr. Noha Adly CSE 322 - Architectural Design 32 computer Dr. Noha Adly CSE 322 - Architectural Design 33 32 33 12/6/2021 The Client–server pattern A client–server architecture for a film library Name Client-server Description In a client–server architecture, the functionality of the system is organized into services, with each service delivered from a separate server. Clients are users of these services and access servers to make use of them. Example Figure 6.11 is an example of a film and video/DVD library organized as a client–server system. When used Used when data in a shared database has to be accessed from a range of locations. Because servers can be replicated, may also be used when the load on a system is variable. Advantages The principal advantage of this model is that servers can be distributed across a network. General functionality (e.g., a printing service) can be available to all clients and does not need to be implemented by all services. Another adv is separation and independence: Services and servers can be changed without affecting other parts of the system. Disadvantages Each service is a single point of failure so susceptible to denial of service attacks or server failure. Performance may be unpredictable because it depends on the network as well as the system. May be management problems if servers are owned by different organizations. Dr. Noha Adly CSE 322 - Architectural Design 34 Dr. Noha Adly CSE 322 - Architectural Design 35 34 35 Pipe and filter architecture Pipe and filter architecture Pattern of the run-time organization of a system where May be referred to as a pipe and filter model (as in UNIX functional transformations process their inputs and shell). produce outputs. it was possible to link processes using ‘pipes’. Data flows from one to another and is transformed as it a transformation ‘filters out’ the data it can process from its input moves through the sequence. data stream. Variants of this approach are very common. When Each processing step is implemented as a transform. transformations are sequential, this is a batch sequential Input data flows through these transforms until converted model which is extensively used in data processing to output. systems e.g. billing systems The transformations may execute sequentially or in Not really suitable for interactive systems. parallel. The data can be processed by each transform item by item or in a single batch. Dr. Noha Adly CSE 322 - Architectural Design 36 Dr. Noha Adly CSE 322 - Architectural Design 37 36 37 12/6/2021 An example of the pipe and filter architecture used in The pipe and filter pattern payments system 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. Example Figure 6.13 is an example of a pipe and filter system used for processing invoices. 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. Dr. Noha Adly CSE 322 - Architectural Design 39 Dr. Noha Adly CSE 322 - Architectural Design 38 38 39 Application architectures Application systems are designed to meet an organizational need. As businesses have much in common, their application systems also tend to have a common architecture that Application architectures reflects the application requirements. All businesses need to hire people, issue invoice, keep accounts All phone companies need systems to meter calls, manage their networks, issue bills to customers etc.. Application architectures encapsulate the principal characteristics of a class of systems 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. e.g. ERP, Dr. Noha Adly CSE 322 - Architectural Design 40 supply chain management, Dr. Noha Adly etc.. CSE 322 - Architectural Design 41 . 40 41 12/6/2021 Use of application architectures Examples of application types Software designer use models of application architectures to Data processing applications As a starting point for architectural design. Data driven applications that process data in batches without If you are unfamiliar with the type of application that you are developing, you explicit user intervention during the processing. can base your initial design on a generic application architecture. Transaction processing applications As a design checklist. Data-centred applications that process user requests and update You can check that your design is consistent with the generic architecture. information in a system database. As a way of organizing the work of the development team. Event processing systems You can assign work to group members to implement different components within the architecture. Applications where system actions depend on interpreting events from the system’s environment. As a means of assessing components for reuse. Language processing systems As a vocabulary for talking about application types. Applications where the users’ intentions are specified in a formal language that is processed and interpreted by the system. Dr. Noha Adly CSE 322 - Architectural Design 42 Dr. Noha Adly CSE 322 - Architectural Design 43 42 43 Application type examples Transaction processing systems Two very widely used generic application architectures Systems are designed to process user requests for information from a DB or requests to update a DB Transaction processing systems A database transaction is sequence of operations as an database-centered applications that process user requests for atomic unit. information and update the information in a database the most common type of interactive business systems From a user perspective a transaction is: user actions can’t interfere with each other and the integrity of the Any coherent sequence of operations that satisfies a goal; database is maintained. For example - find the times of flights from London to Paris. E-commerce systems; Reservation systems, banking systems Language processing systems TP systems are interactive: Users make asynchronous requests for service which are then processed by a User intentions are expressed in a formal language (e.g. Java). transaction manager. The system processes this language into an internal format and then interprets this internal representation. Ex: withdraw money from a bank account using an ATM. Get Compilers; Command interpreters, markup languages e.g. XML details of the account, check the balance, modify the balance, and send commands to the ATM. Dr. Noha Adly CSE 322 - Architectural Design 44 Dr. Noha Adly CSE 322 - Architectural Design 45 44 45 12/6/2021 The conceptual architectural structure of transaction The software architecture of an ATM system – processing applications Pipe and Filter A user makes a request to the system through an I/O processing component. The request is processed by some application specific logic. A transaction is created and passed to a transaction manager, which is usually embedded in the database management the architecture of ATM, illustrating the functions of the input, process, and system. output components. After the transaction manager has ensured that the transaction The system is composed of two cooperating software components—the ATM software and the account processing software in the bank’s database is properly completed, it signals to the application that server. processing has finished. The input and output components are implemented as software in the ATM and the processing component is part of the bank’s database server. Dr. Noha Adly CSE 322 - Architectural Design 46 Dr. Noha Adly CSE 322 - Architectural Design 47 46 47 Information systems architecture Layered information system architecture All systems that involve interaction with a shared database can be considered to be transaction-based information systems. An information system allows controlled access to a large base of information, such as a library catalog, a flight timetable, or the records of patients in a hospital. Increasingly, information systems are web-based Information systems have a generic architecture that can be organised as a layered architecture Layers include: The user interface User communications: handles all input and output from the user interface Information retrieval: includes application-specific logic for accessing and updating the database System database Dr. Noha Adly CSE 322 - Architectural Design 48 Dr. Noha Adly CSE 322 - Architectural Design 49 48 49 12/6/2021 The architecture of the Mentcare system Web-based information systems Information and resource management systems are now usually web-based systems where the user interfaces are implemented using a web browser. For example, e-commerce systems are Internet-based resource management systems that accept electronic orders for goods or services and then arrange delivery of these goods or services to the customer. In an e-commerce system, the application-specific layer includes additional functionality supporting a ‘shopping cart’ in which users can place a number of items in separate transactions, then pay for them all together in a single transaction. Dr. Noha Adly CSE 322 - Architectural Design 50 Dr. Noha Adly CSE 322 - Architectural Design 51 50 51 Server implementation Language processing systems The organization of servers in these systems usually Language processing systems translate a natural or reflects the four-layer generic model artificial language into another representation of that The web server is responsible for all user language and, for programming languages, may also communications, with the user interface implemented execute the resulting code. using a web browser; In software engineering, compilers translate an artificial The application server is responsible for implementing programming language into machine code. application-specific logic as well as information storage Other language-processing systems may translate an and retrieval requests; XML data description into commands to query a The database server moves information to and from the database or to an alternative XML representation. database and handles transaction management. Natural language processing systems may translate one natural language to another e.g., French to Arabic. Dr. Noha Adly CSE 322 - Architectural Design 52 Dr. Noha Adly CSE 322 - Architectural Design 53 52 53 12/6/2021 The architecture of a language processing system Compiler components A lexical analyzer, which takes input language tokens and converts them to an internal form. A symbol table, which holds information about the names of entities (variables, class names, object names, etc.) used in the text that is being translated. A syntax analyzer, which checks the syntax of the language being translated. It uses a defined grammar of the language and builds a syntax tree. A syntax tree, which is an internal structure representing the program being compiled. A semantic analyzer that uses information from the syntax tree and the symbol table to check the semantic correctness of the input language text. A code generator that ‘walks’ the syntax tree and generates abstract machine code. Dr. Noha Adly CSE 322 - Architectural Design 54 Dr. Noha Adly CSE 322 - Architectural Design 55 54 55 Composite Repository and a pipe and filter compiler A repository architecture for a language processing system architecture Dr. Noha Adly CSE 322 - Architectural Design 56 Dr. Noha Adly CSE 322 - Architectural Design 57 56 57