Singleton (Anti-) Pattern

I’ve implemented my first design patterns at college, while creating a web system during the software engineer course. My classmates and I needed a facade class with a single instance of it throughout the system. So, because we’re really smart, we’ve applied the Facade and Singleton pattern. Actually, we’ve implemented the patterns without knowledge of … Continue reading Singleton (Anti-) Pattern

Visitor Pattern and the Open-Closed Principle

A few weeks ago, I described here the Open-Closed Principle, which says that software entities should be open for extension, but closed for modification. Now, imagine you are facing with the following design problem: You need to add a new functionality to a hierarchy of classes, but the act of adding it will be painful … Continue reading Visitor Pattern and the Open-Closed Principle