I've already developed some projects with NHibernate and I can say that NHibernate is a real time saver. But I must admit that it takes some time to get used to NHibernate. As an ORM NHibernate has fantastic features but if you want to develop successfull projects with NHibernate you must know that NHibernate is only one part (ORM) of a successfull layered architecture. In the attached solution I tried to give you the basic idea of a layered architecture and how NHibernate can be used within suc... [More]

Posted in: NHibernate  Tags:
GoF book says that "Observer pattern should defina a one-to-many dependency between objects so that when one object changes state, all its dependenst are notified and updated automatically". Subscribing to RSS feeds is a nice analogy.  You subscribe to RSS feeds to show interest and you become an observer who demand for notification and RSS feeds become the subject and are responsable for providing information to all subscribers. I think this bit of information describing the pa... [More]

Posted in: C# , GoF Patterns  Tags:
I believe Factory Pattern is one of the most known pattern in development community. Simply Factory Pattern states that we have a factory object which is used to create other objects. But GoF specification for the Factory Pattern is a little bit different. GoF book says that "We should define an interface for creating an object, but let subclasses decide which class to instantiate." More...

Posted in: C# , GoF Patterns  Tags:
BlogEngine .NET 1.3 uses www.gravatar.com/avatar.php?gravatar_id=[MD5 Hash] to retreive Gravatar images for the comments. But this url is not supported by Gravatar anymore as far as I understand. We have to replace this url with this one http://en.gravatar.com/avatar/. In order correct this url open CommentView.ascx.cs file found in "User controls" folder and replace the source code of the Gravatar method with this one [code=csharp;ln=on]  protected string Gravatar(s... [More]

Posted in: BlogEngine.NET  Tags:
Download Source(23,52 kb) We have different kind of vehicle implementations inherited from an abstract Vehicle class. Our code looks like this [code=csharp;ln=on;Inital version of our abstract Vehicle class and its concrete implementations]    //Abstract Vehicle class     public abstract class Vehicle     {         public abstract string Description { get; }     }     &n... [More]

Posted in: C# , GoF Patterns  Tags:
I'm sure that you have already heard at least one of the following common design/development tips Seperate out parts of code that will be subject to change over time from the rest of your code Use has-a relationship instead of is-a relationship where possible, that is prefer composition over inheritance Strategy pattern helps us to realize these tips in our designs. By applying the Strategy Pattern we move our algorithm implementations, which are possible source of maintainanc... [More]

Posted in: C# , GoF Patterns  Tags: