3

I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the "Inheritance Mapping" option and removed the abstraction layer and started to use ORM entities directly as domain objects.

After some time, I got a road block when I don’t use abstraction layer. Please read it here: https://stackoverflow.com/questions/11470037/get-all-associate-composite-objects-inside-an-object-in-abstract-way

  1. Is it possible to achieve all tasks without using Abstraction layer over ORM?
  2. What are the rationale to decide have/not have abstraction layer?

REFERENCE:

  1. http://martinfowler.com/bliki/OrmHate.html
asked Jul 13, 2012 at 12:18
1
  • 5
    The ORM is the abstraction between the relational database and your objects. Unfortunately, it is a leaky abstraction, as most such abstractions are. Commented Jul 13, 2012 at 12:20

1 Answer 1

1
  1. Depends on the tasks and the ORM used. both NHibernate and Entity Framework are feature rich which makes it very likely they can. NH also has many hooks you can implement to change its behaviour

  2. abstracttions always have costs (learning, dependency, ...) so unless the value they provide outperforms the costs they should be avoided. An ORM is already an abstraction which most of the time provides more value (when relational Database access is involved).

answered Jul 15, 2012 at 16:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.