SubSonic and ORM

Looking into other ORMs and Linq I came across subsonic. I watched the video and build a quick little sample application with it. I had a slight problem at first because it kept giving me an error with my MySql.Data reference. I upgraded my DLL and played around with it some more, still no luck. I searched around for a bit before I found the answer, if you use their sonic.exe tool, you need to use their MySql.Data.dll as well.

Once that problem was solve, Subsonic was actually very nice to work with. I used work’s database which is a horrid mess (my boss thinks he knows DBA and won’t listen to reason.) So some of the objects sonic.exe built didn’t work correctly, I simply excluded them from the project and everything was fine. My sample code doesn’t do a whole lot but has taught me several things.

Wellness.UserCollection users = new Select().From<Wellness.User>().ExecuteAsCollection<Wellness.UserCollection>();

foreach (Wellness.User user in users)
{
    Response.Write("<p>");
    Response.Write(user.FirstName +" "+ user.MiddleInitial +" "+ user.LastName);
    Response.Write("<br />");
    Response.Write(user.Email);
    Response.Write("</p>");
}

One thing it did was make me question my own ORM project, I thought about abandoning it for SubSonic (or something like it.) But there are several things I don’t like about SubSonic. One is the perl design of giving me tons of different ways to accomplish the same task. personally I find it to be a mess. (Maybe SubSonic just takes some getting used to.) Peeking inside of the generated objects I was disappointed at the amount of code required for a seemingly simple object. My objects can’t do everything that SubSonic’s can, so maybe it’s a necessary evil.

Something I love about it is their use of generics. I like the way it looks and reads.

I think I’m going to continue my ORM development for now (not that I’ve spend a whole lot of time on it.)  I like my design the object to fit you needs and there is one correct way to do things approach.

Share

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Comment »

 
  • Gerard says:

    I’m looking into .NET ORMs as well (I’m also building my own ORM);
    I hadn’t come across subsonic. Looks interesting, but I can definitely see your point about “different ways to accomplish the same task”. This makes browsing through the subsonic documentation a bit confusing at first.
    Gerard´s last blog ..DynamicModelMy ComLuv Profile

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled