Lect. 10 Software Architecture Design PDF

Document Details

PicturesqueTantalum

Uploaded by PicturesqueTantalum

Egypt-Japan University of Science and Technology

Dr. Ahmed Hamdy Ahmed Arafa

Tags

software architecture software design computer science programming

Summary

These notes provide an introduction to software architecture design. It details the software design process, covering key concepts like software design, software architecture, and its elements. It also outlines architectural design, and details the elements of a system. The notes are suitable for an undergraduate computer science course.

Full Transcript

Egypt-Japan University of Science and Technology Electronics , Communications and Computer Engineering (ECCE) School CSE-322 : Software Engineering Dr. Ahmed Hamdy Ahmed Arafa CSIT Programs, Egypt-Japan University of Science and Technology (E...

Egypt-Japan University of Science and Technology Electronics , Communications and Computer Engineering (ECCE) School CSE-322 : Software Engineering Dr. Ahmed Hamdy Ahmed Arafa CSIT Programs, Egypt-Japan University of Science and Technology (EJUST). Email : [email protected] : https://www.linkedin.com/in/ahmed-h-arafa/ : +201009855673 Ch. 4 Software Architecture Design Software Architecture and Design ▪ Software design ✓ The practice of taking a specification of a system then adding details needed for actual system implementation, including human interaction, task management, and data management details until its architecture has been designed. ✓ Software is not one long list of program statements, but it has structure / Architecture ▪ Software Architecture ✓ The fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution. ✓ One of the most powerful mechanisms for describing an architecture is hierarchical decomposition. Product line (or product family) highest abstraction level System or product Subsystems/Modules Packages Classes/Objects Methods lowest level Source code Software Architecture and Design (Cont.) Architectural design is concerned with understanding how a 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 components in a system and the relationships between them. The output of the architectural design process is an architectural model that describes how the system is organized as a set of communicating components. 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. 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. Architectural representations ✓ Simple, informal block diagrams showing entities and relationships are the most frequently used method for documenting software architectures Advantages of explicit Architecture Stakeholder communication Architecture may be used as a focus of discussion by system stakeholders. System analysis Means that analysis of whether the system can meet its non-functional requirements is possible. Large-scale reuse The architecture may be reusable across a range of systems Product-line architectures may be developed. Use of architectural models ▪ As a way of facilitating 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. ▪ As a way of documenting 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. Software Design objectives  Correctness ✓ The goal is to produce correct designs which meet the requirements and the physical and social environment in which the system will operate.  Verifiability ✓ It should be verified for correctness.  Completeness ✓ Specifying all components including all relevant data structures, modules, external interfaces, and module interconnections  Flexibility ✓ Able to be modified on changing needs  Traceability ✓ The entire design element is traceable to the requirements.  Efficiency ✓ Design a software that use the resources by efficiently.  Simplicity / Maintainability ✓ It must be simple to simplify the maintenance. Software Design Process ▪ The design phase deals with transforming the customer requirements as described in the SRS documents into a form implementable using a programming language. ▪ The software design process can be divided into the following three levels or phases of design: ✓ Interface Design ✓ Architectural Design ✓ Detailed Design ▪ Elements of a System ✓ Architecture This is the conceptual model that defines the structure, behavior, and views of a system. We can use flowcharts to represent and illustrate the architecture. ✓ Modules These are components that handle one specific task in a system. A combination of the modules makes up the system. ✓ Components This provides a particular function or group of related functions. They are made up of modules. ✓ Interfaces This is the shared boundary across which the components of a system exchange information and relate. ✓ Data This is the management of the information and data flow. Software Design Process (Cont.) ▪ Interface design ✓ The specification of the interaction between a system and its environment (users , devices and other systems). ✓ This phase proceeds at a high level of abstraction with respect internal structure of the system Internal of the systems are completely ignored, and the system is treated as a black box. ✓ It focus on the dialogue between the target system and the users, devices, and other systems with which it interacts. Scenarios and behavior diagrams are used. ✓ The design problem statement produced during the problem analysis step should identify the people, other systems, and devices which are collectively called agents. ✓ Interface design should include the following details: Precise description of events in the environment, or messages from agents to which the system must respond. Precise description of the events or messages that the system must produce. Specification of the data, and the formats of the data coming into and going out of the system. Specification of the ordering and timing relationships between incoming events or messages, and outgoing events or outputs. Software Design Process (Cont.) ▪ Architectural design ✓ The specification of the major components of a system, their responsibilities, properties, interfaces, and the relationships and interactions between them. ✓ In architectural design, the overall structure of the system is chosen, but the internal details of major components are ignored. ✓ Class and flow-based diagrams are used. ✓ Issues in architectural design includes: Decomposition of the systems into major components. Allocation of functional responsibilities to components. Component Interfaces. Component scaling and performance properties, resource consumption properties, reliability properties, and so forth. Communication and interaction between components. ✓ Note: The architectural design adds important details ignored during the interface design. Design of the internals of the major components is ignored until the last phase of the design. Software Design Process (Cont.) ▪ Detailed design ✓ The specification of the internal elements of all major system components, their properties, relationships, processing, and often their algorithms and the data structures. ✓ The detailed design may include: Decomposition of major system components into program units. Allocation of functional responsibilities to units. User interfaces. Unit states and state changes. Data and control interaction between units. Data packaging and implementation, including issues of scope and visibility of program elements. Algorithms and data structures. Software Quality guidelines ✓ A design is generated using the recognizable architectural styles and compose a good design characteristic of components and it is implemented in evolutionary manner for testing ✓ A design of the software must be modular (the software must be logically partitioned into sub elements) ✓ In design, the representation of data , architecture, interface and components should be distinct. ✓ A design must carry appropriate data structure and recognizable data patterns. ✓ Design components must show the independent functional characteristic. ✓ A design creates an interface that reduce the complexity of connections between the components with external environment. ✓ A design must be derived using the repeatable method. ✓ The notations should be use in design which can effectively communicates its meaning. Software design Concepts ▪ Abstraction (Hide Irrelevant data) ✓ Hide the details of the internal design or implementation to reduce complexity and increase efficiency or quality. ✓ Users are allowed to see only required information. Procedural abstraction: Collection of subprograms some are hidden, and some are visible (Public and Private members) Data Abstraction: Collection of data to describe data objects then show representation data and hide the manipulation data. ✓ Different levels of Abstraction are necessary at each stage of the design process so that any error that is present can be removed to increase the efficiency of the software solution and to refine the software solution. ✓ The solution should be described in broad ways that cover a wide range of different things at a higher level of abstraction and a more detailed description of a solution of software should be given at the lower level of abstraction. ▪ Architecture ✓ The structure of program modules where they interact with each other in a specialized way. ✓ Structural Properties: Architectural design represent different types of components, modules, objects & relationship between these. ✓ Extra-Functional Properties: How design architecture achieve requirements of Performance, Capacity, Reliability, Security, Adaptability & other System Characteristics. ✓ Families of related systems: The architectural design should draw repeatable patterns. They have ability to reuse repeatable blocks, Software design Concepts (Cont.) ▪ Design Pattern (Repeated form) ▪ Repeated form or design in which the same shape is repeated several times to form a pattern. ▪ The pattern in the design process means the repetition of a solution to a common recurring problem within a certain context. ▪ Design patterns can be organized into groups based on what kind of problem they solve. ✓ Creational patterns Create objects (e.g., Singleton, Factory method, Builder,…etc.) ✓ Structural patterns Organize classes and objects to form larger structures that provide new functionality (e.g., Bridge, Fcade, Proxy..etc.) ✓ Behavioral patterns Provide communication between objects and realizing these patterns (e.g. Command, Mediator, Servant, ,…etc.) ✓ Concurrency patterns Deal with multithreaded programming (e.g., Reactor, Schedular , Balking , Active Object, ,…etc.) Software design Concepts (Cont.) ▪ Modularity (subdivide the system) ✓ Dividing the system into smaller parts known as modules to reduce the complexity of the system. ✓ The parts should created independently and then use these parts in different systems to perform different functions. ✓ After developing the system modules, they are integrated together to meet the requirements. ✓ It helps in effective development, accommodate changes easily, conduct testing , debugging and maintenance efficiently. ✓ Modularity criteria: Coupling & cohesion: Coupling ✓ Coupling between two modules indicates the degree of interdependence or number of relations between them. ✓ Coupling degree: it determines the interface complexity Uncoupled: modules that have no interconnection among them. Tightly /Highly coupled: modules are strongly dependent on each others. Loosely coupled: modules are not much dependent on each others or have weak interconnection among them. ✓ A good design has a low coupling. ✓ High coupling generates more errors because they share large number of data items. Software design Concepts (Cont.) ✓ Types of coupling: Content coupling: The modules share the same contents (data , functions) so, changing one requires updating the others. Common coupling: The modules only share information through global data items. External coupling: Modules are tied to an environment external to software by sharing externally imported data format, communication protocol or device interface. Control coupling: data from one module controls instruction execution in another (handles functional flow between modules). Stamp coupling: The modules communicate using composite data item (composite data item, as structure / object is passed as a parameter between the two modules.) Data Coupling: elementary data item that is passed as a parameter between the two modules. Software design Concepts (Cont.) Cohesion ✓ It is the degree to which elements of the module are interrelated to each others. ✓ It measures the closeness or the strength of the relationship between functionality elements of the module. ✓ A good software has high degree of cohesion. ✓ A cohesive module performs a single task within a software procedure, requiring little interaction with procedures being performed in other parts of a program. ✓ Types of cohesion Coincidental Cohesion: performs a set of tasks that relate to each other very loosely (e.g. calculator (add ,sub , mul)) Logical Cohesion: all elements of the module perform similar operations. Temporal Cohesion: all the functions of the module must be executed at the same time. Procedural Cohesion: set of functions of the module are all part of a procedure. Communicational Cohesion: all the functions of the module refer to or update the same data structure Sequential Cohesion: elements of a module form the parts of a sequence. Functional Cohesion: different elements of a module cooperate to achieve a single function ✓ Note: Low coupling and high cohesion are necessary in good software. Functional Independence Software design Concepts (Cont.) Good vs Bad modularization Software design Concepts (Cont.) ▪ Information Hiding (Hide the Information) ✓ Hide the information so that it cannot be accessed by an unwanted party. ✓ In software design, information hiding is achieved by designing the modules in a manner that the information gathered or contained in one module is hidden and can’t be accessed by any other modules. ✓ Data structures and algorithms details of one module are not accessible by others. ✓ They pass only information to each others that is require to accomplish the require functionality. ▪ Refinement ✓ Refinement simply means to refine something to remove any impurities if present and increase the quality. ✓ The refinement concept of software design is a process of developing or presenting the software or system in a detailed manner which means elaborating a system or software. ✓ Refinement is very necessary to find out any error if present and then to reduce it. ✓ It is top-down design approach and process of elaboration ✓ A program is developed for refining levels of procedural details ✓ A hierarchy is established by decomposing a statement of function in a stepwise manner till the programming language statement is reached. Software design Concepts (Cont.) ▪ Refactoring (Reconstruction) ✓ It means reconstructing / changing the internals software system in such a way that it does not affect the behavior of any other features. ✓ In software design, it means reconstructing the design to reduce complexity and simplify it without impacting the behavior or its functions. ✓ Fowler has defined refactoring as “the process of changing a software system in a way that it won’t impact the behavior of the design and improves the internal structure”. ✓ When the software is refactored, the existing design is examined for redundancy, unused design elements , unnecessary design algorithms, poorly structured data, inappropriate data structure and any design failure that can be corrected for better design. Any Questions?

Use Quizgecko on...
Browser
Browser