Thursday, May 28, 2015

Practical Software Design Principles

Practical Software Design Principles


Some practical design principles based on something I read on DZone (http://java.dzone.com/news/practical-software-design-few ):
  1. Before designing a module visualize what it would look like when it is completed. It gives a great perspective when you can actually visualize the end products and makes designing the individual components which make up the module easier. 
  2. Do not realize too heavily on UML diagrams for creating the initial design. Flow diagrams which show the data flow and API calls along with the API documentation make up for a sufficiently good design documentation. UML is not bad, its just that it is not necessary to know it. 
  3. The best way to understand the design of a system is to go through the code. Design for a software keeps on changing, no matter how good is the initial design. This happens because new requirements keep coming in and the design documents are generally not updated as frequently, so a well documented code is the best way to understand the design of a system.
  4. Refactoring is inevitable. There can be n number of reasons, why we need to refactor our code. Refactoring does not mean that the design is not good. The aim should be that the design should be such that it is open to change and change easily. Also the changes required should be minimal like removing a method, extracting some method as a util method so that it can be called from various parts of the code.