tags:

views:

1322

answers:

6

We are re-writing one of our core web applications and I finally got the all clear from management to replace the horrible tangle of stored procedures with an ORM framework for implementing our data access layer.

Hooray for me. Now I have to choose one.

I have played around a little bit with the following

Now I know that NHibernate is the true Alt.Netty choice but the problem is that I am working with contractors who as far as I know have never heard of it, and NHibernate has a reputation for quite a learning curve. Subsonic in the meantime seems like a far more straightforward approach. I also am aware of the Entities Framework but am wary of its 'meh' reception and Linq to Oracle but am wary of the fact that I've hardly heard anything about it.

So the questions are:

  1. Are there any more frameworks I should be considering?
  2. Which do you recommend for my situation?

Some more considerations:

  • When I say I have a played around a bit with these frameworks, I mean it. I have configured them and used them to pull in some data to make sure it all works. That's the extent of it.
  • This is an Oracle database (as you might have guessed from the inclusion of Linq2Oracle)
  • Since this is a re-write, the database already exists and has a stable schema
  • I am not too worried about performance. Our application usually serves at most a couple people at a time.
  • You guys are the ones who are going to have to answer the torrent of questions I'm gonna have

I'm leaning toward Subsonic, but I'm curious what people might have to say.

+6  A: 

Have you checked out Telerik's OpenAccess ORM? They recently acquired Vanatec and their ORM product. It supports multiple database platforms (including Oracle), LINQ support, forward & reverse mapping, is integrated with Visual Studio, and in my opinion (granted I am somewhat biased) is a suitable replacement for LINQ to SQL if that is the kind of "ease of use" you are looking for.

Kevin Babcock
I will check it out, thanks
George Mauer
I am specifically looking for something that would be easy for myself and for Indian contractors to learn with the least friction and given that there is no expert on the team to run to.
George Mauer
Telerik has great support, so that should help if you're working with a distributed team.
Todd
It includes Oracle but It is only for express edition. It does not include the other versions of oracle unless you pay for it. Just FYI
mcauthorn
The free version of OpenAccess works with any of the free database editions (SQL Server Express, Oracle XE, MySQL). If you are using a professional or enterprise-level database solution (SQL Server, Oracle, etc) then you must purchase OpenAccess.
Kevin Babcock
+3  A: 

CoolStorage.NET is my recommendation. If you're stuck doing .NET it's the simplest feature full solution.

Never heard of it, but will take a look. How is the support community?
George Mauer
Doesn't support Oracle!
George Mauer
Since it's open source I would bet porting the native sqlclient bingings to the oracle equivs wouldn't be that difficult. As for the community I find it's quite active.
Also I apologize for not digesting your requests more, I knew they covered most bases but it figures when you don't do enough diligence it always comes back to bite.
+3  A: 

NHibernate will let you decouple your domain entities from your data layer. It does that with XML mapping files to describe the relationship, and uses Castle DynamicProxy to magic up properties that lazy load.

NHibernate is several generations ahead of everyone else in terms of performance, flexibility, and configurability. However, as you said, it is complex. SubSonic is very straight forward, but it is basically generating up static proxy classes based off of your database, so you won't really have the RM out of ORM. IMO SubSonic, L2S, and Castle ActiveRecord are all DAL generators, not ORMs.

IMO it all depends on your needs. If you are talking 2-tier, then go for one of the DAL generators. It will get you moving faster, and your model probably isn't so complex that you can't just generate it up from your db schema. If you have n-tier, I would highly recommend NHibernate. Sure, the learning curve is higher (its not rocket science, but it isn't push button either), however it can actually handle the job that you need, and if you use one of the others you will just end up doing alot of stuff manually anyways.

Matt Briggs
I think in the case of subsonic I would have each of my repositories calling Subsonic queries and mapping them to my domain entities. In the case of activerecord and L2O I would use the classes as DTOs and map in my repository also.
George Mauer
This is higher maintenance, I know, but the premium for me is on simplicity.
George Mauer
The question is where you want the simplicity. I see hundreds of lines of left side = right side object mapping more complex and harder to maintain then sql, especially if you have objects in your domain model that pull from multiple tables.
Matt Briggs
That being said, I have used subsonic on a few projects now, and have nothing but good things to say about it.
Matt Briggs
+1  A: 

Well the issue when considering an ORM is

  • finding good information about it. Examples, Learning materials.
  • do enough people use it (is the product mature)? the more companies use it the more likely the bugs have been found.

When I look at the ORM market for .Net I am finding more and more material on NHibernate

Links to helpful material about Nhibernate <- Videos, tools, and best practices

Castle is built ontop of NHibernate (It is using the Active Record pattern)

Have a google to see if the ORM;s have any tools which help you develop faster.

  • Telerick says it comes with VS intergration
  • Nhibernate has a couple of tools to reverse engineer a DB into classes, also there is NHProf (not free) which monitors the SQL between NH and SQL

if you are not into XML mapping files, see if you can find a Fleunt mappings. Which should mean compile time checking (some people find this to be easier to debug/refactor code)

fluent nhibernate

HTH

Bones

dbones
I am quite aware of the wonderful writing on NHibernate that has become available since I last tried to learn it in august, but how accessible is it really? Are contractors really going to wade through 50 pages of tutorial to grok the concept so they can apply it? I don't know...
George Mauer
You are correct the manual is large, however there are many sample projects out there which demo the concept fast.. look at Sharp Archecture, on codeproject.also please do not get cought on the documentation, I also refer to tools and ways of mapping (XML/code) these are great factors too.
dbones
+2  A: 

I would reconsider your evaluation of Microsoft's Entity Framework. You can use DevArt's DotConnect provider for Oracle as a solution until Oracle releases their own provider in the future. Using the Entity Framework, you would then not use "Linq to Oracle", but rather "Linq to Entities" which is a much better solution.

I've had VERY good results from my testing of read operations using the Entity Framework where the read operations were ~700% faster than its SqlCommand\SqlDataReader equivilent.

Rick
Like I said, performance is not a concern, but some of the criticisms from the Alt.Net community are.
George Mauer
Sure, and their concerns were valid and will be addressed later in .NET 4.0 I expect. Their concerns were mostly around the use of Entity Framework with existing classes because EF requires a base class for each of the entities that it creates. Some folks didn't like that.
Rick
+1  A: 

Checkout XmlDataMapper a simple free ORM (LGPL Licence) which leaves a low memory footprint compared to the other giants. The sample project provided should be good enough to get started.

To integrate XmlDataMapper all you need to do is 4 little steps

  1. Create a Business Entity / DTO for the tables
  2. Create an XML File with the mapping information between the table and the DTO.
  3. Specify the DTO and xml file in the configuration.
  4. Just call the DTOConverter.Convert(dataReader) and other such methods to convert your database record to DTO / Business Entity
Binoj Antony