Principles of Software Designing

July 02, 2019

It is very easy to build a software or app. But, it is trickier to have a good design that gives you good maintainability over long period of time, and that serves the purpose.

Listing down few design principles that can help greatly in designing applications or softwares:

Move the code what varies and encapsulate it so that it wont affect rest of the code

In simpler terms: Identify the aspects of your application that vary and separate them from what stays the same. It will result in more flexibility in your code. And, this is very powerful concept, as it is being used in many design patterns.

Program to an interface, not an implementation

It gives you a lot of flexibility in changing the actual implementation at any time, without the need to change the code. Or, change in smaller portion of the code. Otherwise, you are bound to some implementation, and for every new implementation change, you need a massive code change.

Favor composition over inheritance

Inheritance is good but in practical, this can become overhead. Many beginner consider it as re-usability. But, Composition provides reusablity. It provides several benefits like: - You can encapsulate the implementation or algorithms - You can change the behavior at runtime - You can have list of that object instead of inheritance

Similar Posts

Latest Posts