Data accessors or Entity framework

Topics: Data Access Application Block
Jul 28, 2010 at 10:56 AM

Entlib 5 sugest me use with data accessors for mapping data from database to my data objects.

But in .NET 3.5 and especially in .NET 4, I can use entity framework to describe my data object and get data into my objects (ORM).

What data accessors uses advantages over the entity framework?

What differences that should be affect on my using decisions?

Jul 29, 2010 at 8:26 AM

If you want an ORM, use EF.

If you want rich data mapping tooling (designers, etc.) use EF.

If you want to write your objects back to the database, use EF (accessors are read-only).

If you're already using DAAB, and want to remove repetitive data reader loops with lots of really simple left = right assignments to construct your data objects, accessors are great.

Accessors are a deliberately simple solution aimed at 75%.


My personal opinion is, if you're writing new code, prefer to go with EF, especially if you're working with a domain model. If you've got existing code that already uses DAAB, then the accessors can really clean up your reads out of the database.