Breaking Information Hiding in C++

Almost every object-oriented programmer is familiar with the concept of information hiding. Actually, lots of them get confused with the terms encapsulation and information hiding. So, before we talk aboutĀ information hiding itself, let me explain the difference of both terms: Encapsulation is the public interface that defines how an object can be used, and how … Continue reading Breaking Information Hiding in C++

Principles of Package Design

Agile Software Development is really an incredible book. After reading it, a lot had been talked about the Object-Oriented Principles on this blog (here andĀ here). Today, I'll be talking about another section of the book, which introduces principles used to maintain high package cohesion and a desirable package dependency, known as Principles of Package Design. … Continue reading Principles of Package Design

Generic DAO with NHibernate and Autofac

Data access is one of the most important design decisions in software development. Depending on how you design your data access classes, every single modification causes cascading changes throughout your project. Imagine you have a lot of persistent data objects to manage and, for example, you have to change your database. This transition must be … Continue reading Generic DAO with NHibernate and Autofac

Google Maps and the MarkerClusterer solution

Hi everyone, today I'll be writing a small post about a problem that most people who write maps application deal with: add thousands of markers in you map. A known solution to manage your marker is GMarkerManager. However, today I read about the MarkerClusterer solution in GeoGoogleDevelopers Blog. "MarkerClusterer collects markers into different clusters and … Continue reading Google Maps and the MarkerClusterer solution

C# Extension Methods

I've been talking about Object-Oriented Principles for a while, and this post will not be different. Here and here, I've introduced OOP and described an elegant solution to comply with Open-Closed Principle using Visitor Pattern, respectively. Today I'll be talking about a C# 3.0 feature called extension methods. Maybe you're now asking what extension methods … Continue reading C# Extension Methods

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