Blog

horizontal line graphic

Subscribe to Kevin Southworth's Blog  Subscribe to my RSS feed | Categories | Search

SubSonic vs. EntitySpaces – A Battle of OR/Ms

Tuesday, January 30, 2007 @ 11:11 PM :: 4117 Views :: 16 Comments ::
Categories: .NET, Software Development, Web Development

I was quite overwhelmed recently when I started researching  OR/M tools for the latest ASP.NET 2.0 project at work.  There are so many to choose from, all with their own unique take on what it means to be a good object-relational mapping tool.  I only wanted to spend a day or two researching/evaluating OR/M tools, and I narrowed it down to SubSonic and EntitySpaces for my final showdown.

SubSonic

I first heard about SubSonic about 6 months ago from one of the many ASP.NET blogs I subscribe to.  The goal of the project is to bring some of the cool RAD tools from the Ruby-on-Rails world into ASP.NET.  One of the nicest features of SubSonic is that it mostly “just works” without too much effort.  There’s no crazy-complicated XML mapping files (I’m looking at you NHibernate…) or mountains and mountains of auto-generated code to dig through (N-Tiers).  SubSonic utilizes a cool feature of the VS2005 and ASP.NET environment called “Build Providers”. All you have to do is make a few adjustments to your web.config file, add a special file to your App_code directory and you’re done!  Whenever you compile/build your VS solution, SubSonic reads your database schema and dynamically generates Data Access classes.

EntitySpaces

I only recently became familiar with EntitySpaces.  A former co-worker of mine really likes the d00dads architecture, the precursor to EntitySpaces.  EntitySpaces takes the code-generation approach, utilizing the popular free code-generation tool MyGeneration.  EntitySpaces is essentially a few .NET dll’s and some MyGeneration code templates.  You load up MyGeneration, open the Entityspaces templates, point them at your database tables, and MyGeneration will spit out a bunch of Data Access and Biz Logic classes in either C# or VB.NET.  My favorite features of EntitySpaces are it Scaffolding support (to auto-generate administration screens for all of your database tables) and its great support for hierarchical data models.

Shot of a scaffold page (notice the drop-down auto-generated for the FK column)

es2_CropperCapture[1].Jpg

SubSonic

Good Stuff

·         Free and Open Source!

·         Easy to get started / mild learning curve

·         Dynamic Queries

·         Strongly-typed wrapper classes for all your stored procedures

·         Active forums, frequent releases

Chinks in the armor

·         Scaffolding support is buggy

·         Doesn’t handle GUID keys very well

·         Weak support for navigating PK/FK relationships

·         Geared towards ASP.NET only (WinForms is possible)

EntitySpaces

Good Stuff

·         Auto-generated scaffolding is very powerful / time-saving

·         Dynamic Queries

·         Very good support for navigating PK/FK collections in code

·         Able to regenerate Data Access code without affecting your custom business logic

·         Serialization of objects for web services, etc.

·         Active forums / support

Frown Face

·         Not free or open source ($80 for Express edition)

·         No strongly-typed access to stored procedures (it is scheduled for next release though)

Final Thoughts

In the end I chose to drop the $80 for EntitySpaces because of its superior Scaffolding and PK/FK Hierarchical support, both of which have been big time-savers so far, allowing me to focus more on the “real guts” of my application instead of Data Access code.  The addition of stored procedure wrappers in the next version will make it even more attractive in my opinion.   However, I’m definitely going to keep an eye on the SubSonic project, since they are adding features all the time.  The biggest things preventing me from using SubSonic right now are the relatively buggy scaffolding support for GUID data types, as well as the weaker support for navigating hierarchical PK/FK collections in code.

Rating
Comments
By Martin @ Friday, February 09, 2007 3:21 PM
Hi

I don't usually post comments on blogs - especially when they're comparing different apps/frameworks etc as I really don't have time to get embroiled in flame wars between camps but thought in this instance I'd take a different stance (and no, I'm not asking to get involved in a "who's best battle" - it's all an individual thing).

I must start by saying that I've been looking at different OR/M's and DAL generators for a while now (a couple of years on and off - watching what's happening really).

Now, my reasons for looking for framework/ORM type providers is simple - I want to concentrate on the elements of my applications that are 'unique' - i.e. the business problem rather than how to a) describe my objects (although I've already had to do this on the DB side) and/or how to deal with persistance/querying etc. While the business objects may differ between projects, the plumbing to get these working shouldn't differ too much (if at all).

Anyway, I've looked at quite a few possible solutions for this aspect (including doodads, NetTiers, LLBLGen, LLBLGen Pro, ORM.Net, RapTier to name but a few) and although they all have something to offer, my final choice (and my buying choice) fell to EntitySpaces and to be frank, I haven't looked back.

As I say, each and every one of the frameworks that I looked at had something very valuable to offer, and my "process of elimination" between them probably taught me more about what I want/don't want more than any other exercise, but when it came down to it, with pretty much everything else other than ES, I always got to a point where I had to work around an issue with the framework.

For example, some have excellent data binding support but lack a decent query API, others are the reverse. Some are built with things like the MS Enterprise Application Blocks in mind and the integration is seamless, others require fudging to integrate etc. The list could go on (for me).

Now, for me at least, EntitySpaces gave me exactly what *I* needed - no huge learning curve which left me to concentrate on what I wanted/needed to, integration with things like the MS Exception Handling Block with little real work, an absolutely excellent query API etc etc. To be frank, there is nothing I've had to try to hack at this point - obviously that may change, but it's just a relief for me as the need for hacks tend to crop up quite quickly using some of the other frameworks I've tried.

To finish, all of the frameworks I've tried have something very valuable to offer, and I'd heartily recommend that anyone go down the route of trying for yourself (given sufficient time of course), but for me, EntitySpaces does what I need without me having to think twice about it and that is what has made it the perfect (and only real) choice for me.

Enough rambling (and apologies for taking up so much room - guess I should share my wordcount between blogs instead of dumping them all in one eh?!)

Cheers
Martin

By Chris Pritchard @ Monday, February 12, 2007 1:11 PM
ES is an awesome tool. For anyone to give it a frowny face for the fact that they charge for it is kinda on the lame side. It is not by coincidence that this is the best tool out there. It could have something to do with the fact that they do charge a nominal fee to use it. I know that is probably a minor complaint, but compared to a tool that needs work arounds from the get go, it seems like a bargain :)

By Nigel Stratton @ Wednesday, February 21, 2007 3:12 PM
First I would expect ES to charge, how else do they put bread on the table so they can keep on coding?

How do I use scaffolding, autogenerating dataentry forms?

By Kevin Southworth @ Wednesday, February 21, 2007 11:55 PM
The point of my post was just to show the pros/cons to each framework, and if you're looking for a free OR/M solution then of course the fact that ES is not free is going to be a con ;) However, I completely agree that EntitySpaces is well worth the price!

As for scaffolding, all you need to do is to download the ASP.NET templates from the EntitySpaces website (it's a separate download from the main ES framework) and then run them through MyGeneration and it'll build out your scaffold pages for you.

By Rob Conery @ Friday, February 23, 2007 1:26 PM
Hi Kevin - a nice write up! Thanks for taking the time to play with SubSonic :). I am always interested to know what people are thinking with their evaluations and it's always of interest to know where the shortcomings are.

In terms of buggy scaffold - some detail might help. I think you might have picked up on some threads in our forums where users were having issues with many-to-many relationships. If not, and you encountered bugs, please do let me know.

Finally - I wish you could have had a chance to play with 2.0, which is due out in 4 weeks. If you're interested in a beta test, I'll happily send along to you :).

Thanks again for the writeup....

Rob

By Kevin Southworth @ Friday, February 23, 2007 2:31 PM
Thanks for the comment Rob! I didn't know there was a SubSonic 2.0 in the works, I will definitely check it out when it releases and post a follow-up to my review here.
Keep up the great work with SubSonic!

By Ricky kay @ Sunday, February 25, 2007 7:55 AM
Entityspaces is good but there is http://www.easyobjects.net/
But even more powerful is nettiers.com
yes you need to but codesmith but i have found nothing in comparison for MY projects. ps i have the following products

llblgenpro2
wilsonormapper
codesmith
mygeneration
subsonic
ado.net vNEXT CTP (microsoft new product)
meremortals framework
strataframe(thinking of buying)


ByMike Griffin @ Monday, January 14, 2008 8:18 AM
From the looks of the lastest post by Rob SubSonic has cloned our (EntitySpaces) DynamicQuery API almost exactly, so you know EntitySpaces is leading the way.

By Rob Conery @ Monday, January 28, 2008 12:17 AM
Cloned? Mike I don't know anything about EntitySpaces and if it was "cloned" it was not intentional. I think both of us value fluent interface SQL.. yes?

By Donna @ Friday, July 11, 2008 4:12 PM
This article is very helpful, but it's now 1.5 years old.

Might you have some updated information on these two?

By Donna @ Sunday, July 13, 2008 7:06 PM
If you do decide to update any of this information, could you please consider including information about:

1. LLBLGen Pro,
2. Opf3,
3. Microsoft's Entity Framework?

Thanks!

Donna

By Donna @ Sunday, July 13, 2008 7:08 PM
By the way, for those concerned...

I contacted Entity Spaces a week ago two different times and have yet to get any response. I have all but written them off in my consideration for an OR/M solution. Anyone else experience this?

By Martin @ Monday, July 14, 2008 3:24 AM
Hi Donna

I'm surprised you haven't had a reply from the EntitySpaces team - they're usually very (very) quick to respond to enquiries/support issues - did you use the support@entityspaces.net email address?

I wouldn't write EntitySpaces off - having had experience of a lot of different ORMs it won hands down for my needs.

Cheers
Martin

ByMike Griffin @ Monday, July 14, 2008 10:34 AM
Donna, sorry about that. On our about page it says "Please do not email us directly for technical support, we have support forums for that purpose" and I realize many probably don't consider their questions to be "technical support" but nonetheless you cannot imagine the mail I still get, had you posted on our forums you would have probably received a response in under an hour. The reason we like to answer questions on the forums is then they are there for others to see.

By Mike Griffin @ Monday, July 14, 2008 10:45 AM
Donna, I did just reply and gave you futher contact info.

ByMark McG @ Thursday, July 31, 2008 11:06 AM
We have been using entityspaces here for quite a while now and think it is fantastic. The small cost of a licence is nothing compared to the time it has saved us on projects. It's fantastic mobile support has allowed us to churn out databases onto Windows Mobile devices that would make quite a few desktop developers quiver in their boots with no slowdowns what so ever.

Hats of to ES!

Click here to post a comment