views:

99

answers:

4

I am developing an application which at the moment queries a (rather large) database via ADO.NET and hard-coded SQL statements. Admittedly this is ugly (i.e. no compile time errors thrown if a mistake is made in the SQL) and potentially dangerous (due to SQL injections, etc although this is unlikely to be a problem for this particular application) but this wasn't considered initially because this application is really only interested in a very small subset of tables in this database (at least for now...).

LinqToSQL seemed interesting but because this application is required to have the ability to connect to Oracle databases as well, that plan was a non-starter.

Is a project like mine suitable for integration with an ORM framework or would that be overkill?

+1  A: 

I would recommend a generated DAL instead of an ORM, or Linq.

Look into subsonic http://subsonicproject.com/. It is an open source DAL generator that is very easy to learn and use, and has a very low overhead.

Bruce McLeod
I haven't used SubSonic myself, but read the author's blog regularly. I think it is probably a great DAL for first entry into the DAL and ORM fields.
mkmurray
+2  A: 

I think an ORM should always at least be considered.

But it doesn't sound like you're even using business objects (Sometimes referred to as a Data Access Layer or DAL) which greatly undermines the usefulness of an object oriented language. I would address this first. If you find it's too time consuming to create all the CRUD for the business objects it's time for an ORM...

My personal favorite is nHibernate. Big learning curve but definitely worth it.

Spencer Ruport
+1  A: 

I would definitely say that it is a candidate for an ORM framework. The overhead of setting up the ORM is quite small once you have familiarized yourself with a framework, and the benefits are many.

As you say, LinqToSQL is not appropriate if you might need Oracle support, but most other frameworks support Oracle.

If you only use a small subset of the tables, then you will only have to map a small subset of the tables and hence the setup cost will decrease even further.

Good luck!

Erik Öjebo
A: 

Try using something that generates sql (Like Linq, only with Oracle), instead of an orm.

Why? Jeff Atwood explains.

Quote:

"At first you're like "whee! objects!" and then you realize-- hey, this is a lot of tedious, error-prone mapping code I didn't have to write before... "

asperous.us