Husband, father, and .NET developer
 Search
Writing Decoupled, Testable Code With SubSonic
6/19/2008

I've said it before, and I'll say it again.  I love working with SubSonic!  One of the only problems I've had with it is figuring out how to properly separate layers while using SubSonic.  Rather than dealing with that problem, I have just avoided it and let all my data access and business rules all hang out together in my UI (specifically ASP.NET code-behind).  And since I'm not writing tests for this project, testability hasn't been an issue.  Wow.  I feel dirty having just written those two sentences.  Luckily, due to the relatively small scope of the project I'm on, those issues haven't burned me too bad yet.

Anyway, Rob Conery just posted a great entry on his blog dealing with this exact issue.  He talks about using the Repository pattern and SubSonic 2.1 to properly separate your layers and allow for mapping between your DB and your application's model.  Of course, separation leads to better testability as well. 

It's too late in the game for me to change the architecture on my existing project, but I will definitely be looking at this approach very seriously on any new development.  If you're actively using SubSonic and don't already have your layers adequately separated, I would highly recommend Rob's post.  Thanks for the info, Rob!

Add Your Comment


Your name:
Title:
Comment:
Add Comment   Cancel 
Subscribe via Email Subscribe via Email
Subscribe via RSS Subscribe via RSS

View my Facebook page
View my Twitter page
View my del.icio.us links
View my profile on LinkedIn

My latest on Twitter:
    
 
    
Copyright 2007 Michael Paladino