CSC550 Software Engineering Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington simmondsd@uncw.edu Introduction to Software Architectures Devon M. Simmonds Computer Science Department, CSC592 1 Architectural Design • Lecture Outline – Architectural styles • • • • • Layered Client-server Event-based Shared repository Class exercise – Other topics on Architectures • Interceptors, adaptive software, failure models, design requirements – Summary Devon M. Simmonds Computer Science Department, CSC592 2 What is Software Architecture? • A model describing the overall structure of the software in terms of components/subsystems, their interrelationships and behaviors. A P K M B Devon M. Simmonds Computer Science Department, CSC592 C 3 3 General Architecture of Distributed Systems A P K M B C • An architectural model defines structure - system components and their relationships as well as behaviour – how components interact. • The goal of architectural design is to meet present and future demands on the architecture. • Each architectural style defines a class of architectures. Devon M. Simmonds Computer Science Department, CSC592 4 Architectural Styles Architectural styles • An architecture style is a specification of how subsystems in a software may be structured. – Specification of architectural components – Specification of architectural connectors Component N Component N-1 – Specification of constraints on how components can be combined • Specification of component interaction (data exchange) – Specification of component configuration to form a system • Specification of one or more semantic models that specify how a system’s overall properties can be determined from the properties of its parts Devon M. Simmonds Computer Science Department, CSC592 Component 2 Component 1 5 5 Architectural Styles, cont. • What is an architectural component/subsystem? – A modular unit with well defined provided and required interfaces that is replaceable. Component N Component N-1 • What is an architectural connector? – A mechanism that mediates communication, coordination or cooperation among components. • E.g. remote procedure calls, message passing Component 2 Component 1 Devon M. Simmonds Computer Science Department, CSC592 6 Architectural Styles, cont. Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 7 Layered Architectures, cont. A Layered Architectural Style • Figure 2-1. Tanenbaum et al. Devon M. Simmonds Computer Science Department, CSC592 8 Layered Architectures, cont. Classical Three-Tiered Architecture • Figure 2-4 (Tanenbaum). The simplified organization of an Internet search engine into three different layers. Devon M. Simmonds Computer Science Department, CSC592 9 Layered Architectures, cont. Characteristics of layered Architectures • Advantages – Clear separation of parts/roles/subsystems. – Easy to plug and play components. – Relatively simple to implement as either a concurrent or sequential system. Devon M. Simmonds Computer Science Department, CSC592 10 10 Architectural Styles Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 11 Client-server (“two-tier”) architectures • A network architecture in which each computer or process on the network is either a client or a server. Devon M. Simmonds Computer Science Department, CSC592 12 12 Architectural Styles •The client/Server Model Client invocation res ult Server invocation Server res ult Client Key: Process : Computer: Fig. 2.2 Coulouris et al.: Clients invoke individual servers Devon M. Simmonds Computer Science Department, CSC592 13 Coulouris etal.Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Client/Server Model, cont. Client-server characteristics • Advantages – Distribution of data is straightforward; – Makes effective use of networked systems. May require cheaper hardware; – Easy to add new servers or upgrade existing servers. • Disadvantages – No shared data model so sub-systems use different data organisation. Data interchange may be inefficient; – Redundant management in each server; – No central register of names and services - it may be hard to find out what servers and services are available. Devon M. Simmonds Computer Science Department, CSC592 14 14 Coulouris etal.Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Architectural Styles, cont. Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 15 Object-Based Architectural Style • Figure 2-1. (b) The object-based architectural style. Devon M. Simmonds Computer Science Department, CSC592 16 Coulouris etal.Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Architectural Styles, cont. Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 17 Event-Based Architectural Style • Figure 2-2. (a) The event-based architectural style Devon M. Simmonds Computer Science Department, CSC592 18 Coulouris etal.Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Architectural Styles, cont. Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 19 Shared repository Architectural Style • Figure 2-2. (b) The shared data-space architectural style. Devon M. Simmonds Computer Science Department, CSC592 20 Shared Repository Characteristics • Advantages – Efficient way to share large amounts of data; – Sub-systems need not be concerned with how data is produced Centralised management e.g. backup, security, etc. – Sharing model is published as the repository schema. • Disadvantages – Sub-systems must agree on a repository data model. Inevitably a compromise; – Data evolution is difficult and expensive; – No scope for specific management policies; – Difficult to distribute efficiently. Devon M. Simmonds Computer Science Department, CSC592 21 21 Coulouris etal.Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 Architectural Styles, cont. Important architectural styles for distributed systems • Layered architectures • Client/Server architectures • Object-based architectures • Data-centered architectures • Event-based architectures • Model View Controller Devon M. Simmonds Computer Science Department, CSC592 22 The Model-view-controller architecture Data Model change notifies Controller query View Functionality change User Interface • Separates the application object (model) from • The way it is presented to the user (view), from • The way in which the user controls it (controller). Devon M. Simmonds 23 Computer Science Department, CSC592 23 Devon M. Simmonds Computer Science Department, CSC592 24 Architectural Design Example • Draw layered, client-server, and data-centric architectures using this description. – A school video library tracking system is to be developed. Videos can be scientific, religious or general. General videos are classified as miscellaneous, sports or entertainment. Students and professors can belong to research groups. A research group must have at least 2 professors. Every student must belong to some research group. Professors that belong to a research group are called research professors. Research professors do not teach courses every semester. Each semester, a student must register for at least one course offered by a professor in his research group. A student cannot register for courses outside the subject areas of the research groups in his academic department. A research group can consist of members with various subject area interests. However, subject areas are only classified as an area of interest for the group if at least two members have interest in the area. In general, professors can check out any number of videos, however, visiting professors can check out at most seven videos. Unlike regular professors, visiting professors can check out videos for the duration of only two weeks. Students can check out any number of religious videos and at most 2 scientific videos. Students can check out only scientific videos in the subject areas Devon M. Simmonds represented Computer Science Department, CSC592 in their research groups. 25 Summary: What an architectural model does • Simplify and abstract the functions of individual components • Consider the placement of components across a network of computers, seeking to define useful patterns for the distribution of data and workload • Consider the interrelationships between the components, i.e., the functional roles and patterns of communication between them Devon M. Simmonds Computer Science Department, CSC592 26 CSC550, Devon M. Simmonds, Computer Science Department, University of North Carolina Wilmington Q u e s t i o n ??????????????? s ? …CSC550 … Devon M. Simmonds Computer Science Department, CSC592 The End 27 Architectural Design Example • Draw layered, client-server, and data-centric architectures using this description. – The Exotic Sunshine Corporation needs software to aid the management of its business. The corporation is made up of several different companies each having at least three of the seven divisions. The corporation classifies divisions as either production, sales or marketing. The sales and marketing divisions are given jurisdiction for a specific geographic region. This region must include the company that owns the division. Regions have managers, however, an employee may only manage two or more regions if he/she has in excess of ten years experience with the company, or ten years in a comparable position. Managers with more than ten years service and managers in the head office are allowed thirty days of paid vacation per year. In addition, they may have up to three company vehicles assigned and one of the vehicles may be a luxury vehicle. Other managers are not allowed luxury vehicles and cannot be allocated in excess of one vehicle. The corporation manufactures and sells boats, electronic equipment, fruit juices and paper. Devon M. Simmonds Computer Science Department, CSC592 28