Chapter : 8 Design Concepts

42
Chapter : 8 Design Concepts

description

Design Within The Context Of Software Engineering Each of the elements of the requirement model provides information that is necessary to create design models required for a complete specification of design. Figure : 8.1 The requirement model, manifested by scenario-based, class-based, flow-oriented, and behavioral oriented elements, feed the design task.

Transcript of Chapter : 8 Design Concepts

Page 1: Chapter : 8 Design Concepts

Chapter : 8

Design Concepts

Page 2: Chapter : 8 Design Concepts

Design Within The Context Of Software Engineering

•Each of the elements of the requirement model provides information that is necessary to create design models required for a complete specification of design.

•Figure : 8.1

•The requirement model, manifested by scenario-based, class-based, flow-oriented, and behavioral oriented elements, feed the design task.

Page 3: Chapter : 8 Design Concepts

•The data/class design transforms class models into design class realizations and the requisite data structures required to implement the software.

•The architectural design defines the relationship between major structural elements of the software, the architectural styles and design patterns that can be used to achieve the requirements defined for the system, and the constraints that affect the way in which architecture can be implemented.

•The interface design describes how the software communicates with the system that interoperate with it, and with humans who use it.

Page 4: Chapter : 8 Design Concepts

• The component-level design transforms structural elements of the software architecture into a procedural description of software component. Information obtained from the class-based models, flow-models, and behavioral models serve as the basis for component design.

Page 5: Chapter : 8 Design Concepts

Design Process Software design is an iterative process through which requirements are translated into “blueprint” for constructing the software.

Software Quality Guidelines And Attributes

Characteristics that serve for the evolution of a good design suggested by McGlaughlin

•The design must implement all of the explicit requirements contained in the analysis model and it must accommodate all of the implicit requirements desired by the customer.

Page 6: Chapter : 8 Design Concepts

• The design must be understandable guide for those who generate code and for those who test.

• It should provide a complete picture of the s.w .

Page 7: Chapter : 8 Design Concepts

Quality Guidelines

• The design should exhibit an architecture that (1) has been created using recognizable architectural styles or patterns, (2) is composed of components that exhibit good design characteristics, and (3) can be implemented in an evolutionary fashion.

• A design should be modular; i.e., the s.w should be logically partitioned into elements/ subsystems.

• It should contain distinct representation of data , architecture , interfaces and components.

Page 8: Chapter : 8 Design Concepts

• A design should lead to data structure that are appropriate for the classes to be implemented.

• A design should lead to component that exhibit independent characteristics.

• A design should lead to interfaces that reduces the complexity of connection between components and with the external environment.

• It should be derived using a repeatable method that is driven by information obtained during s.w requirements analysis.

• It should be represented using a notation that effectively communicates its meaning.

Page 9: Chapter : 8 Design Concepts

Quality Attributes • Functionality:- it is assessed by evaluating the

feature set, capabilities of the program , generality of the function that are delivered, and security of the overall system.

• Usability:- it is assessed by considering human factors, overall aesthetic, consistency, and documentation.

• Reliability:- it is evaluated by measuring the frequency and severity of failure, ability to recover from failure, accuracy of output results etc.

Page 10: Chapter : 8 Design Concepts

• Performance:- it is measured by processing speed, response time, efficiency etc.

• Supportability:- extensibility + adaptability + serviceability ( maintainability )

Page 11: Chapter : 8 Design Concepts

Design Concepts Abstraction

• When you consider a modular solution to any problem, many levels of abstraction can be posed.

• At the highest level of abstraction, a solution is stated in broad terms using the language of the problem domain.

• At the lower level of abstraction, a more detailed description of the solution is provided.

Page 12: Chapter : 8 Design Concepts

• At the lowest level of abstraction, the solution is stated in a manner that can be directly implemented.

• Procedural abstraction refers to a sequence of instructions that have a specific and limited function. E.g. the word open for door. It is long sequence:- walk to the door, reach out and grasp knob, turn knob, and pull door, step away from moving door.

• Data abstraction is a named collection of data that describes a data object. E.g. the data abstraction for would be a set of attributes (door type, weight, swing direction)

Page 13: Chapter : 8 Design Concepts

Architecture

• Architecture is the structure or organization of program components (module), the manner in which these component interact, and the structure of the data that are used by the components.

• A set of properties that should be described as part of an architectural design :1) Structural properties : This aspect of the architectural design representation defines the components of a system and the manner in which those components are packaged and interact with one another.

Page 14: Chapter : 8 Design Concepts

2) Extra-functional properties : The architectural design description should address how the design architecture achieves requirements for performance, capacity, reliability, security and other system characteristics.

3) Families of related system : The architectural design should draw upon repeatable patterns that are commonly encountered in the design of families of similar systems.

The architectural design should can be represented using one or more of a number of different models.

Page 15: Chapter : 8 Design Concepts

1. Structural model:- represents architecture as an organized collection of components.

2. Framework:- identifies repeatable architectural design frameworks that are encountered in similar types of applications.

3. Dynamic:- indicates how structure / system may change as functional of external events.

4. Process:- focuses on the design of the business or technical process that the system must accommodate.

5. Functional model:- can be used to represent the functional hierarchy of system.

Page 16: Chapter : 8 Design Concepts

Separation Of Concerns• Separation of concerns suggests that any

complex problem can be more easily handled if it is subdivided into pieces that each can be solved and/or optimized independently.

• A concern is a feature or behavior that is specified as part of the requirements model for the software.

• By separating the concerns into smaller, a problem takes less effort and time to solve.

Page 17: Chapter : 8 Design Concepts

• For two problems , p1 and p2, if the perceived complexity of p1 is greater than the perceived complexity of p2, it follows that the efforts required to solve p1 is greater than the efforts required to solve p2.

• The perceived complexity of two problems when they are combined is often greater than the sum of the perceived complexity when each is taken separately.

• This leads to a divide-and-conquer stratergy.

Page 18: Chapter : 8 Design Concepts

Modularity• Software is divided into separately named and

addressable components , called modules ,that are integrated to satisfy problem requirements.

• Monolithic software, large program composed of

a single module, can not be easily grasped by software engineer because of the no of control paths, span of reference, no of variables etc.

• Figure 8.2

Page 19: Chapter : 8 Design Concepts

• No of modules increases - cost or effort decreases

• No of modules increases – cost associated with integrating modules also grows.

• Explain Figure 8.2

Page 20: Chapter : 8 Design Concepts

Information Hiding • The principle of information hiding suggests that

modules can be characterized by design decisions that (each) hides from all others.

• Modules should be designed so that information contained within a module is inaccessible to other modules that have no need for such information.

• Hiding implies that effective modularity can be achieved by defining a set of independent modules that communicate with one another only that information necessary to achieve software function.

Page 21: Chapter : 8 Design Concepts

• It helps when modifications are required during testing and later during software maintenance.

Page 22: Chapter : 8 Design Concepts

Functional Independence

• Functional independence is achieved by developing modules with “single-minded” function and “aversion” (dislike) to excessive interaction with other modules.

• You should design software so that each module addresses a specific subset of requirements and has a simple interface when viewed from other parts of program structure.

• Software with effective modularity is easier to develop and easier to maintain.

Page 23: Chapter : 8 Design Concepts

Independence is assessed using two qualitative criteria : cohesion and coupling.

Cohesion• Indication of the relative functional strength of

module.• Modules should carry out a single processing

function• Objective is to maximize cohesion • Highly related elements should be in the same

module.

Page 24: Chapter : 8 Design Concepts

Coupling

• Indication of relative interdependence among modules.

• Coupling depends on the interface complexity between modules, the point at which entry or reference is made to a module, and what data passes across the interface.

• One module should have little dependence on any other module.

Page 25: Chapter : 8 Design Concepts

• Loose coupling minimizes the interdependence between modules.

• Low coupling facilitates high cohesion. Modules with single responsibility tend to communicate less with other modules.

Page 26: Chapter : 8 Design Concepts

Refinement • Stepwise refinement is a top-down strategy.

• A program is developed by successively refining levels of procedural detail.

• It is a process of elaboration.

• We begin with a statement of the function that is defined at high level of abstraction.

Page 27: Chapter : 8 Design Concepts

• That is , the statement describes functions or information conceptually but provides no information about internal workings of the function or the internal structure of the data.

• We then elaborate on the original statement, providing more and more details as each successive refinement occurs.

Page 28: Chapter : 8 Design Concepts

Aspects• As requirements analysis occurs, a set of

“concerns” is uncovered.

• These concerns include requirements, use cases, features, data structures etc.

• As design begins, requirements are refined into a modular design representation.

• Consider two requirements A and B. Requirement A crosscuts requirement B “If a software decomposition has been chosen in which B can not be satisfied without taking A into account”

Page 29: Chapter : 8 Design Concepts

• An aspect is a representation of crosscutting concerns.

• It is important to identify aspects so that the design can properly accommodate them as refinement and modularization occur.

• In an ideal context, an aspect is implemented as a separate module.

Page 30: Chapter : 8 Design Concepts

Refactoring

• It is the process of changing a s.w system in such a way that it does not alter the external behavior of the code yet improves its internal structure.

• When the s.w is refactored , the existing design is examined for redundancy, unused design elements, inefficient or unnecessary algo., poorly constructed or inappropriate data structure or any other design failure that can be corrected to yield a better design.

Page 31: Chapter : 8 Design Concepts

Design Classes

• As the design model evolves, we will define a set of design classes that refine the analysis classes by providing design details that will enable the classes to be implemented, and implement a software infrastructure that supports the business solution.

• Five types of design classes :

1) User Interface Classes define all abstractions that are necessary for human-computer interaction.

Page 32: Chapter : 8 Design Concepts

2) Business Domain Classes identify the attributes and services (methods) that are required to implement some element of the business domain.

3) Process Classes implement lower-level business abstraction required to fully manage the business domain classes.

4) Persistent Classes represent data stores that will persist beyond the execution of the software.

5) System Classes implement software management and control functions that enable the system to operate and communicate within its computing environment and with outside world.

Page 33: Chapter : 8 Design Concepts

Characteristics of well formed Design Classes :

1) Complete and sufficient : A design class should be the complete encapsulation of all attributes and methods be expected to exist for a class. Sufficiency ensures that the design class contains only those methods that are sufficient to achieve the intent of the class, no more and no less.

2) Primitiveness : Methods associated with a design class should be focused on accomplishing one service for the class. Once the service has been implemented with a method, a class should not provide another way to accomplish the same thing.

Page 34: Chapter : 8 Design Concepts

3) High Cohesion : A cohesive design class has a small, focused set of responsibilities and single-mindedly applies attributes and methods to implement those responsibilities.

4) Low Coupling : Within the design model, it is necessary for design classes to collaborate with one another. Collaboration should be kept to acceptable minimum.

Page 35: Chapter : 8 Design Concepts

The design model • The design model can be viewed in two different

dimensions.

• The process dimension indicates the evolution of the design model as design tasks are executed as a part of the software process.

• The abstraction dimension represents the level of details as each element of the analysis model is transformed into a design equivalent and then refined iteratively.

Page 36: Chapter : 8 Design Concepts

Elements Of Design Model

1) Data Design Elements :-• Data design creates model of data /

information that is represented at a high level of abstraction( customer / user’s view) .

• This data model is then refined into more implementation specific representations that can be processed by the computer-based system.

• At the program component level, the design of data structures and the associated algorithms required to manipulate them is essential to the creation of high-quality application.

Page 37: Chapter : 8 Design Concepts

• At application level, the translation of data model into a database is pivotal to achieving the business objectives of a system.

• At the business level, the collection of information stored in disparate databases and recognized into a “warehouse” enables data mining or knowledge discovery.

Page 38: Chapter : 8 Design Concepts

2) Architectural Design Elements :-• It gives overall view of the software.• It can be derived from three sources: (1)

information about the application domain for the s.w to be built (2) specific requirement model element like DFDs. (3)availabilty of architectural styles and pattern

• The architecture design elements is usually depicted as a set of interconnected subsystems.

Page 39: Chapter : 8 Design Concepts

3) Interface Design elements :- • It tells how information flows into and out of the

system and how it is communicated among components.

• There are three important elements of interface design

• There are three important elements of interface designa) User Interface : UI design incorporates aesthetic elements, ergonomic elements and technical elements.b) External Interfaces to other systems, devices, networks : The design of EI requires information about the external entities. It should incorporates error checking and security features.

Page 40: Chapter : 8 Design Concepts

c) Internal Interfaces : The design of II is closely aligned with component-level design.

4) Component-Level Design Elements :-• The component-level design describes the

internal details, i.e., data structure for all local data objects and algorithm details.

• In object-oriented software engineering, a component is represented using UML component diagram.

• Figure 8.6

Page 41: Chapter : 8 Design Concepts

• A UML activity diagram can be used to represent processing logic.

• Detailed procedural flow can be represented using either pseudo code or some diagrammatic form.

• Algorithm structure follows the rule established for structured programming.

• Data structures are usually modeled using pseudo code or programming language to be used for implementation.

Page 42: Chapter : 8 Design Concepts

5) Deployment-Level Design Elements :-• The deployment-level design elements

describes how software functionality and subsystems will be allocated within the physical computing environment that will support the software

• During design, a UML deployment diagram is developed and then refined.

• Figure 8.7