Table of contents
1.
Introduction
2.
Software design principles
3.
Modularity
4.
Cohesion
5.
Coupling
6.
FAQs
7.
Key Takeaways
Last Updated: Mar 27, 2024

Principles of Software Design

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Software design principles are concerned with effectively handling the design process's complexity. It is essential to make a better system design since Writing code will only consume 30 to 50 percent in the development process. Remaining, we maintain the system by reading the code. Software design principles will reduce the effort needed for design and reduce introducing errors during the procedure.

Software design principles

We will now discuss different software design principles and their benefits, why design principles are beneficial for us, and how to implement them in our daily programming.

  • S.O.L.I.D.
S According to the software engineering principle, a class must have only one responsibility.
O The software design principle says that you should be able to change the behavior of a class without modifying it.
L Functions that use references or pointers to base classes should unknowingly use objects of derived categories.
I Many client-specific platforms are better than one general-purpose interface.
D The software design principles assert that programmers should depend on abstractions instead of concrete classes.
  • Don’t Repeat Yourself (DRY)
    The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."
  • You Aren't Gonna Need It (YAGNI)
    Most programmers fall into the pit of implementing all the operations at once. Ultimately some or most of these functionalities become useless. It does not mean you should avoid building flexibility into your code. It means you should not overengineer something based on what you think you might need later on.
  • Keep It Simple Stupid (KISS)
    Software design principles state that Always Keep It Simple. It allows you to identify bugs rapidly. If the systems are kept simple instead of complicated, they work better. Therefore, simplicity should be a critical goal in design and avoid unnecessary complexity.
  • Least Astonishment
    Principle of Least Astonishment states that what most users expect to behave a component of a system should behave in that way only. The behavior should not astonish or surprise users.
     

Also see,  V Model in Software Engineering

Modularity

  • The modularity principle is the essential software design principle. According to that, Systems should be built from cohesive, loosely coupled components. 
  • A cohesive part has a well-defined function or purpose. If their interdependencies are minimized, then elements will be loosely coupled. And hence they are easy to understand, reuse, and replace. 
  • It is a structural principle used to manage complexity in systems. It involves identifying functional clusters of similarity in designs and transforming the groups into interdependent self-contained systems (modules).
     

The main properties of a modular system are:-

  • Modules are simpler from the outside than inside.
  • Each module is a well-defined system that can be used with other applications.
  • Modules must be easier to use than to build.
  • Modules must be easier to use than to build.

Hence, it is clear from above that modular design reduces design complexity and results in easier and faster implementation by allowing parallel development of various parts of a system.

Cohesion

It refers to the degree of intra-dependability inside elements of the module. The program design will be better if the cohesion is greater.

It is mainly of seven types:

  • Functional cohesion
    It is considered the highest degree of cohesion, and it is highly expected. Elements of modules in functional cohesion are grouped because they all contribute to a single well-defined function. It can also be reused.
  • Sequential cohesion  
    When elements of a module are grouped because the output of one piece serves as input to another, it is called sequential cohesion.
  • Communicational cohesion 
    When elements of the module are grouped, executed sequentially, and work on the same data (information), it is called communicational cohesion.
  • Procedural cohesion 
    When elements of a module are grouped executed sequentially to perform a task, it is called procedural cohesion.
  • Temporal Cohesion 
    When elements of a module are organized to be processed at a similar point in time, it is called temporal cohesion. 
  • Logical cohesion
    When logically categorized details are put together into a module, it is called logical cohesion.
  • Co-incidental cohesion -
    It results from breaking the program into smaller modules for modularization. Because it is incidental, it may confuse the programmers and is generally not accepted.

So now you get the idea of cohesion in Software Engineering. There is another concept that is used with cohesion, known as coupling.

Coupling

It refers to the level of inter-dependability among modules of a program. It states at what level the modules interfere and interact with each other—the lower the coupling, the better the program.

There are five levels of coupling:

  • Data coupling
    It occurs when two modules interact utilizing passing data (as a parameter). The receiving module must use all its components in case of a module passes data structure as a parameter.
  • Stamp coupling
    When multiple modules share a typical data structure and work on a different part, it is called stamp coupling.
  • Control coupling
    When one of them among the two modules decides to change its flow of execution, then it is called control-coupled.
  • Common coupling
    When they have read and write access to some global data, it is called common or global coupling.
  • Content coupling 
    When a module can directly modify or access or refer to the content of another module, it is called content level coupling.

Among all of them, Data coupling is considered best since it occurs when methods share data regularly through parameters. The module takes precisely what it needs without knowing the format of a particular data structure. The content coupling is considered worst as in this type, and one module can alter the data of another module or control flow when it is passed from one module to the other. 

FAQs

  1. What is the role of design principles in Software Engineering design?
    The role of design principles in Software Engineering design is to arrange and organize the structural components of Software Engineering design.
     
  2. What are the software design pattern types?
    Software design pattern types are Structural Design patterns, Creational Design patterns, and Behavioral Design Pattern are the types of design patterns.
     
  3. What are the 5 OOP principles?
    The 5 OOP principles are open-closed, single responsibility, interface segregation, Liskov substitution, and dependency inversion principle.
     
  4. How is software design different from coding?
    The computer uses software and instructions designed to perform well-defined functions and allow users to perform a specific task. At the same time, coding is a language written using language protocol to develop apps, software, etc. 
     
  5. Which two activities are related to software design concepts? 
    Software requirements analysis and software coding and testing are two activities are related to software design concepts.

Key Takeaways

In this article, we learned about different types of software design principles, we learned about Modularity with its properties. At the end of this blog, we also discussed cohesion and coupling.

Recommended Readings:

You can also consider our System Design Course to give your career an edge over others.

Live masterclass