Design Principles
Design Principles
Software design principles are concerned with providing means to handle the
complexity of the design process effectively. Effectively managing the complexity
will not only reduce the effort needed for design but can also reduce the scope of
introducing errors during design.
Problem partitioning
Abstraction
Modularity
Top down & bottom up stratergy
Problem Partitioning
For small problem, we can handle the entire problem at once but for the significant
problem, divide the problems and conquer the problem it means to divide the problem
into smaller pieces so that each piece can be captured separately.
For software design, the goal is to divide the problem into manageable pieces.
These pieces cannot be entirely independent of each other as they together form the
system. They have to cooperate and communicate to solve the problem. This
communication adds complexity.
Abstraction
1. Functional Abstraction
2. Data Abstraction
Functional Abstraction
i. A module is specified by the method it performs.
ii. The details of the algorithm to accomplish the functions are not visible to the
user of the function.
Functional abstraction forms the basis for Function oriented design approaches.
Data Abstraction
Details of the data elements are not visible to the users of data. Data Abstraction forms
the basis for Object Oriented design approaches.
Modularity
Modularity specifies to the division of software into separate modules which are
differently named and addressed and are integrated later on in to obtain the completely
functional software. It is the only property that allows a program to be intellectually
manageable. Single large programs are difficult to understand and read due to a large
number of reference variables, control paths, global variables, etc.
o Each module is a well-defined system that can be used with other applications.
o Each module has single specified objectives.
o Modules can be separately compiled and saved in the library.
o Modules should be easier to use than to build.
o Modules are simpler from outside than inside.
Advantages of Modularity
Modular Design
Modular design reduces the design complexity and results in easier and faster
implementation by allowing parallel development of various parts of a system. We
discuss a different section of modular design in detail in this section:
The use of information hiding as design criteria for modular system provides the most
significant benefits when modifications are required during testing's and later during
software maintenance. This is because as most data and procedures are hidden from
other parts of the software, inadvertent errors introduced during modifications are less
likely to propagate to different locations within the software.
Strategy of Design
A good system design strategy is to organize the program modules in such a method
that are easy to develop and latter too, change. Structured design methods help
developers to deal with the size and complexity of programs. Analysts generate
instructions for the developers about how code should be composed and how pieces of
code should fit together to form a program.
1. Top-down Approach
2. Bottom-up Approach
1. Top-down Approach: This approach starts with the identification of the main
components and then decomposing them into their more detailed sub-components.
2. Bottom-up Approach: A bottom-up approach begins with the lower details and
moves towards up the hierarchy, as shown in fig. This approach is suitable in case of
an existing system.
DESIGN PATTERNS
There are several methods for creating a pattern, including draping, flat
patternmaking, and computer-aided design (CAD). Draping involves creating the
pattern directly on a mannequin or dress form, while flat patternmaking involves
drawing the pattern pieces onto paper using measurements and calculations. CAD uses
specialized software to create digital patterns that can be edited and adjusted easily.
Once the pattern is complete, it can be used to create a sample garment, which is then
tested for fit and functionality. Adjustments may be made to the pattern based on the
results of the fitting, and the process may be repeated until the desired result is
achieved.
Goal: Understand the purpose and usage of each design pattern in order to pick and
implement the correct pattern as needed.
Example:
In many real-world situations, we want to create only one instance of a class. For
example, there can be only one active president of a country at any given time. This
pattern is called a Singleton pattern. Other software examples could be a single DB
connection shared by multiple objects as creating a separate DB connection for every
object is costly. Similarly, there can be a single configuration manager or error
manager in an application that handles all problems instead of creating multiple
managers.
These design patterns are all about class instantiation or object creation. These
patterns can be further categorized into Class-creational patterns and object-creational
patterns. While class-creation patterns use inheritance effectively in the instantiation
process, object-creation patterns use delegation effectively to get the job done.
Creational design patterns are the Factory Method, Abstract Factory, Builder,
Singleton, Object Pool, and Prototype.
2. Structural Design Pattern
These design patterns are about organizing different classes and objects to form larger
structures and provide new functionality. Structural design patterns are Adapter,
Bridge, Composite, Decorator, Facade, Flyweight, Private Class Data, and Proxy.
2. Efficiency: Creating a pattern saves time and effort in the production process.
Once the pattern is created, it can be used to make multiple garments, reducing
the time and resources needed to create each one.
5. Replicability: Patterns can be replicated and used for different sizes, styles, and
fabrics, making them a valuable asset for designers and manufacturers.
2. Skill: Pattern designing requires specialized knowledge and skills, which may
not be available to everyone.
4. Limited creativity: Working within the confines of a pattern can limit the
designer’s creativity, making it difficult to create unique or innovative designs.
5. Sustainability: The production of patterns, particularly on paper, can contribute
to waste and harm to the environment.
GRASP
1. GRASP