Category Archives: Misc

Open close design principle – SOLID & real time examples

Benjamin disraeli said ‘Change is inevitable, Change is constant’. Change is constant in case of software development also. Software development mostly follows an iterative life cycle. Requirements are changing everyday, either a change in existing functionalities or introduction of new functionalities. Open-closed principle provides guidelines to the software designer/developer, how the software should handle the change… Read More »

Interface segregation design principle (SOLID & real time example)

Interface segregation principle (ISP) is one of the five principles of SOLID acronym. Interface Segregation Principle states “Clients should not be forced to depend upon interfaces that they do not use.” Client should not have the dependency on the interfaces that they do not use. Let us understand the Interface segregation principle with the help of… Read More »

STL Erase-Remove Idiom in C++ (with example)

In C++ programming paradigm, we extensively use the collection frameworks like STL, Its very common practice to remove element(s) from collection(s) like vector. The common practice is just iterate through the container to remove the desired element. But STL has builtin feature specifically to avoid this situation. Erase-Remove idiom comes in our rescue. Erase-Remove is an… Read More »