OR/M Descisions, where to go from here? 3

My co-worker (Kris) and I have been evaluating several OR/M apporaches for our current refactoring of a system that is very clumsy. The current system is an artifact of poor design and uses a very clumsy EF apporach in which business layer information is skewed across all layers on the project. This ends up with a very spagetti like peice of software, and as neither myself or Kris created the project initially, leads us to very long and frustrating episodes to try and fix even the most trivial of bugs. We have tried multiple things to help this and to put off the inevitable, we introduced sophisticated logging, we introduced minor refactors, but all has unfortunately lead us to the one solution – a major code refactoring.

While this is a great way to clean out the code and start from scratch – It’s a very daunting process, and no-one likes refactoring entire projects (especially one as big as this) from scratch. After spending a few weeks and months investigating and playing with different options I am in the process of evaluating a few OR/M’s for the new project.

Wanting to take a DDD approach this times we have spent a bit of time actually building a few different Model Layers (to be consistant with our overall MVC approach for the websites). Which utilise good DDD Practices for testing our total solution. As the final solution is going to be providing an ORM layer for many facets of our solution (MVC Website running on 3.5, WCF 4.0 In Development Workflows) we wanted to make something as scalable as possible.

So we started evaluating how Entity Framework 3.5, 4.0, nHibernate (with fluent nHibnerate and nHinbernate.Linq), ActiveRecord & Subsonic would adapt to our solution. I come from a Ruby background, and while being very familiar with ActiveRecord, the lack of PI and ineffective ability to adapt to the DDD model that myself and Kris wanted to apply unfortunately wrote that model of the list first. Also the fact that Castle ActiveRecord hasn’t recieved a checkin since 2007 was something that really worried us. The current project uses EF1.0 and so for pure use of familiarity we started on this first.

At the time of writing we are yet to choose which ORM we are going to use, so suggestions would be very helpful. Here are some of the advantages and Diadvantages we have come up with for each OR/M thus far (To be updated as I find more).

Entity Framework 3.5
Pros

  • Can already work on .NET 3.5

Cons

  • No Poco
  • Poor Enum Support
  • Projection Transform not Supported
  • No PI

Entity Framework 4.0
Pros

  • Poco Support
  • PI

Cons

  • Can not already work on .NET 3.5
  • Some Pollution involved for Enum Support
  • Projection Transform not Supported

nHibernate 2.1.0 + nHibernate.Linq + fluent nHibernate
Pros

  • Can already work on .NET 3.5
  • Lots of DDD Documentation (In books & Blogs).
  • Projection Transform Supported
  • PI

Cons

  • Pollution in Poco needing to use Virtual
  • Pollution in Poco with relationship Fixups
  • Some LINQ features may not be supported (TBA)
  • Composite keys with Fluent nHibernate is tedious beacuse we have to override GetHashCode() and Equals()

Subsonic (Yet to be evaluated)
Pros

  • Exceptional LINQ Features

Cons
ActiveRecord
Pros

  • Ruby on Rails style OR/M
  • Easy to define models

Cons

  • Does not fit with DDD Patterns
  • No PI / Persistence Pollution in Business Objects
  • Can be sluggish and sloppy in complex systems.

Self-learning, DDD? 4

domain driven design

So it feels like it’s been an eternity since I was fortunate enough to recieve a greencard in the Greencard lottery, and the following actions occured after which; I quit my well paying job at Internet Software provider Channel Advisor and set out to discover the rest of the world.

After a short stint/holiday in europe I finally arrived in Los Angeles to start looking for a job. It took me two weeks, but somehow I had miraculously found myself in a situation where I had a car, an apartment and a few job offers, finally settling for my somewhat Dream Job at Doctors on Demand an Incubator company located in Beverly Hills, California.

So it’s been 6 months since i’ve become adapted to the new and challenging working environment that is the USA Software Development Lifecycle (USDLC). And i’m at a point where I can actually say I love what I do. I’ve worked on various projects from working in Ruby on Rails, PHP (including various frameworks, cakePHP and whatnot) and now i’m on a fantastic project that involves ASP.NET MVC. I must admit that before coming here I was not at all fond of working in any kind of .NET / Visual Studio environment.

While i’m getting pushed to learn new things, especially in this new and evolving world that is MVC (which seems like an atempt for microsoft to finally embrace the advances in web technologies in the last few years, ala Ruby on Rails, jQuery, etc)

Before going too far off point here – let’s get back to the Title – Self Learning, what is it – why do it?

In the past few weeks i’ve been on a bit of a self learning drive – Starting to learn the Guitar is a hobby I have put off for a long time, but I can say now I have a guitar and have started the process. The other thing that I had on my list for a long time was Surfing. I managed to go out one day, get a lesson and I now have 2 surfborads (a 6′6Fish and an 8ft foamie) sitting near my door, and i quite frequently get a surf in before work in the morning!

So now after my two successful attempts for self learning in my ‘3rd place’. I want to apply the self-learning process to my pride, my career. I asked two of my co-workers who I consider to be very skilled programmers what they thought I would best need improving on – and I also kinda hinted some things that I needed to improve on myself (I’m a little rusty at my software patterns).

So it has started, I’ve ordered a book from Amazon.com on software patterns to read at the beach while working on my Tan, and to sit beside me at work whenever I run into trouble with them, ala the days before google could solve the worlds problems in one search.

So I guess the next thing i’m going to be learning here along with revisiting software patterns, is DDD. This topic seems to come up quite a bit with the blogs I read about ASP.NET MVC and one of my co-workers has strongly suggested me to learn it! I’m going to be posting my findings on domain driven design and how I can implement it into my Ruby, .NET and PHP projects along the way.