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

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

Creating a J2ME Web Service Client

This last week I was concentrated in developing a J2ME application that communicates with a Web Service to gather some information about route planning. Basically, the mobile app ask for a route, given an origin and a destination waypoints. Although this kind of work looks very easy, I got some problems to accomplish it. Due to that, I will … Continue reading Creating a J2ME Web Service Client

The Principles of Object-Oriented Design

At this moment, a lot of source code are been writing by thousands and thousands of programmers all around the world. Most of them uses an object-oriented language, but probably just a few have knowledge of the ODD, which I consider crucial for a reusable and extensible project. What are The Principles of Object-Oriented Design … Continue reading The Principles of Object-Oriented Design

Refactoring to Command Pattern

I've spent the last two weeks reading another refactoring famous reference. After Refactoring, I decided to read Refactoring to Patterns, which is also very good, and today I'll share one sample of book's refactoring catalog: Replace Conditional Dispatcher with Command. In this example, you will be able to see some of book's approach and how this practice … Continue reading Refactoring to Command Pattern