Software Design Presentation Transcript:
2.Software Design Process
Software design is not a sequential process. Design of a software system evolves through a number of iterations.
The design process usually involves developing a number of different models, looking at the system from different angles and describing the system at various levels of abstraction.
A activities performed at this stage include design of the software architecture by showing the division of system into sub-systems or modules, the specification of the services provided by these sub-systems and their interfaces with each other, division of each sub-system into smaller components and services and interfaces provided by each one of these components.
Data modeling is also an essential activity performed during the design phase. This includes the identification of data entities and their attributes, relationships among these entities, and the appropriate data structures for managing this data.
3.Software Design Strategies
Two fundamental strategies have been used.
Functional or structured design; and
Object oriented design.
In the functional design, the structure of the system revolves around functions.
The entire system is abstracted as a function that provides the desired functionality.
This main function is decomposed into smaller functions and it delegates its responsibilities to these smaller functions and makes calls to these functions to attain the desired goal.
Each of these smaller functions is decomposed into even smaller functions if needed. The process continues till the functions are defined at a level of granularity where these functions can be implemented easily.
In this design approach, the system state, that is the data maintained by the system, is centralized and is shared by these functions.
5.Object Oriented Design
The object-oriented design takes a different approach. In this case the system is decomposed into a set of objects that cooperate and coordinate with each other to implement the desired functionality.
In this case the system state is decentralized and each object is held responsible for maintaining its own state.
The communication and coordination among objects is achieved through message passing where one object requests the other object if it needs any services from that object.
6.The object-oriented approach has gained popularity over the structured design approach during the last decade or so because, in general, it yields a design that is more maintainable than the design produced by the functional approach.
7.Software Design Qualities
The main quality of software design is maintainable design.
Coupling is a measure of independence of a module or component.
Loose coupling means that different system components have loose or less reliance upon each other.
Hence, changes in one component would have a limited affect on other components
9.Strong cohesion implies that all parts of a component should have a close logical relationship with each other.
That means, in the case some kind of change is required in the software, all the related pieces are found at one place.
Hence, once again, the scope is limited to that component itself.
10.A component should implement a single concept or a single logical entity.
All the parts of a component should be related to each other and should be necessary for implementing that component.
If a component includes parts that are not related to its functionality, then the component is said to have low cohesion.
11.Coupling and Cohesion
Coupling and cohesion are contrasting concepts but are indirectly related to each other.
Cohesion is an internal property of a module whereas coupling is its relationship with other modules.
Cohesion describes the intra-component linkages while couple shows the inter-component linkages. Coupling measures the interdependence of two modules while cohesion measures the independence of a module.
If modules are more independent, they will be less dependent upon others. Therefore, a highly cohesive system also implies less coupling.
12.Modules with high cohesion and low coupling can be treated and analyzed as black boxes.
This approach therefore allows us to analyze these boxes independent of other modules by applying the principle of separation of concern.
13.This diagram depicts two systems, one with high coupling and the other one with low coupling. The lines depict linkages between different components. In the case of highly coupled system, module boundaries are not well defined, as everything seems to be connected with everything else. On the other hand, in the system with low coupling modules can be identified easily. In this case intra component linkages are stronger while inter component linkages are weak.
14.The modules that interact with each other through message passing have low coupling while those who interact with each other through variables that maintain information about the state have high coupling.
15.Strong cohesion implies that all parts of a component should have a close logical relationship with each other. That means, in case some kind of change is required in the software, all the related pieces are found at one place.
A class will be cohesive if most of the methods defined in a class use most of the data members most of the time. If we find different subsets of data within the same class being manipulated by separate groups of functions then the class is not cohesive and should be broken down as shown below.