Slide 1

Slide 1 text

CSE 360 Introduction to Software Engineering Lecture 08: Software Architecture Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment

Slide 2

Slide 2 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 2 We are here

Slide 3

Slide 3 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 3 We are here Java.util javax.swing java.awt

Slide 4

Slide 4 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 4 Next Class + method_1() + method_2() + method_3() void method_1() { // for, if // variables // instructions // call() }

Slide 5

Slide 5 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 5 Next Class + method_1() + method_2() + method_3() void method_1() { // for, if // variables // instructions // call() } Algorithms Architecture

Slide 6

Slide 6 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 6 Homework for this Week Regarding Algorithms: 1. Decision tables and Decision Trees 2. Nassi-Schneiderman Diagrams 3. Flowchart Diagram 4. Pseudocode

Slide 7

Slide 7 text

Software Architecture

Slide 8

Slide 8 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 8 Definition • software design is responsible for the code level design: what each class is doing, its relationships, and scope. • software architecture is responsible for the skeleton and the high-level organization of a software. It identifies the main structural modules (or components) in a system and the relationships between them.

Slide 9

Slide 9 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 9 An Assignment Hardware OS Java VM Apache Log4J SLF4J Hadoop Spark nd4j deeplearning4J

Slide 10

Slide 10 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 10 Architectural Decisions Is there a generic application architecture that can act as a template for the system that is being designed? How will the system be distributed across hardware cores or processors? What architectural patterns or styles might be used? What will be the fundamental approach used to structure the system? How will the structural components in the system be decomposed into sub-components? What strategy will be used to control the operation of the components in the system? What architectural organization is best for delivering the non-functional requirements of the system? How should the architecture of the system be documented? ?

Slide 11

Slide 11 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 11 Architecture Goals • “horizontal” and “vertical” partitioning • define separate branches for each major function • coordinate communication between modules • design so that decision-making, and work are stratified • results in propagation of fewer side effects • results in software that is easier to extend

Slide 12

Slide 12 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 12 Architectural Patterns 1. Model-View-Controller (MVC) 2. Layered Architecture 3. Repository Architecture (Blackboard) 4. Client-Server architecture

Slide 13

Slide 13 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 13 Architectural Representations • Simple, informal block diagrams showing entities and relationships are the most frequently used method for documenting software architectures. • But these have been criticized because they lack semantics, do not show the types of relationships between entities nor the visible properties of entities in the architecture.

Slide 14

Slide 14 text

1. Model-View-Controller Architecture Pattern

Slide 15

Slide 15 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 15 Model-View-Controller

Slide 16

Slide 16 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 16 Model-View-Controller browser

Slide 17

Slide 17 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 17 Model-View-Controller Description Separates presentation and interaction from the system data into three logical components: • Model component manages the system data and associated operations on that data. • View component defines and manages how the data is presented to the user. • Controller component manages user interaction (e.g., key presses, mouse clicks, etc.) and passes these interactions to the View and the Model. 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 Additional code and complexity when the data model and interactions are simple.

Slide 18

Slide 18 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 18 Simplest Implementation Subject Observer

Slide 19

Slide 19 text

2. Layered Architecture Architecture Patterns

Slide 20

Slide 20 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 20 A generic layered architecture

Slide 21

Slide 21 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 21 Layered Architecture

Slide 22

Slide 22 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 22 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. When used Used when : • building new facilities on top of existing systems; • the development is spread across several teams with each team responsibility for a layer of functionality; • 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.

Slide 23

Slide 23 text

3. Blackboard Architecture Patterns

Slide 24

Slide 24 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 24 Blackboard

Slide 25

Slide 25 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 25 Blackboard Description All data in a system is managed in a central repository Components do not interact directly, only through the repository. When used when you have a system in which large volumes of information are generated that has to be stored for a long time. When 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. 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.

Slide 26

Slide 26 text

4. Client-Server Architecture Patterns

Slide 27

Slide 27 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 27 Client-Server

Slide 28

Slide 28 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 28 Client-Server Description The functionality of the system is organized into services. Each service delivered from a separate server. Clients are users of these services and access servers to make use of them. When used Used when data has to be accessed from a range of locations. May also be used when the load on a system is variable. Advantages Distributed 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.

Slide 29

Slide 29 text

Put all together

Slide 30

Slide 30 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 30 What architecture to use here?

Slide 31

Slide 31 text

Javier Gonzalez-Sanchez | CSE360 | Fall 2020 | 31 Homework Complete This Week’s Hybrid Activities

Slide 32

Slide 32 text

CSE360 – Introduction to Software Engineering Javier Gonzalez-Sanchez [email protected] Summer 2017 Disclaimer. These slides can only be used as study material for the class CSE360 at ASU. They cannot be distributed or used for another purpose.