In our ongoing exploration of SOLID design principles, we have previously explored the Single Responsibility Principle (SRP), the Open-Closed Principle (OCP), and the Liskov Substitution Principle (LSP). Now, let’s delve into the fourth principle: the Interface Segregation Principle (ISP).
In our continued exploration of SOLID principles, we’ve navigated through the realms of the Single Responsibility Principle (SRP) and the Open-Closed Principle (OCP). In this blog post, our focus turns to the third pillar of SOLID: the Liskov Substitution Principle (LSP), named after Barbara Liskov. We will unravel its significance in the context of crafting robust and maintainable software systems.
In our exploration of SOLID design principles, we previously delved into the Single Responsibility Principle (SRP), emphasizing the allocation of a single responsibility to each class. Our current focus shifts to the Open-Closed Principle (OCP), which directs our attention towards the broader aspects of extensibility and adaptability within our codebase. This blog post examines the significance of OCP through a practical example in C++.
As software developers, we often grapple with the challenge of writing clean, maintainable and flexible code. One key principle aiding us in achieving these goals is the Single Responsibility Principle (SRP), one of the SOLID principles of object-oriented design. In this blog post, we will delve into the essence of SRP, exploring its significance through a practical example in C++.
This post is motivated by the Euler project’s third problem, finding the largest prime factor of the number n=600,851,475,143. In my humble opinion, the most challenging issue of the problem is how to efficiently determine whether a number is prime, and the best candidate is the sieve of Eratosthenes algorithm. In other words, my strategy is:
A smart pointer is a class that manages a dynamically allocated object, ensuring the dynamically allocated object is properly cleaned up at the appropriate time (usually when the smart pointer goes out of scope).