Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best practice for persistence right now?

I come from a java background.

But I would like a cross-platform perspective on what is considered best practice for persisting objects.

The way I see it, there are 3 camps:

  • ORM camp
  • direct query camp e.g. JDBC/DAO, iBatis
  • LINQ camp

Do people still handcode queries (bypassing ORM) ? Why, considering the options available via JPA, Django, Rails.

like image 404
ashitaka Avatar asked Dec 12 '08 10:12

ashitaka


1 Answers

There is no one best practice for persistence (although the number of people screaming that ORM is best practice might lead you to believe otherwise). The only best practice is to use the method that is most appropriate for your team and your project.

We use ADO.NET and stored procedures for data access (though we do have some helpers that make it very fast to write such as SP class wrapper generators, an IDataRecord to object translator, and some higher order procedures encapsulating common patterns and error handling).

There are a bunch of reasons for this which I won't go into here, but suffice to say that they are decisions that work for our team and that our team agrees with. Which, at the end of the day, is what matters.

like image 122
Greg Beech Avatar answered Oct 02 '22 17:10

Greg Beech