What's the difference between a "Data Service Layer" and a "Data Access Layer"?

ilitirit picture ilitirit · Sep 25, 2008 · Viewed 18.5k times · Source

I remember reading that one abstracts the low level calls into a data agnostic framework (eg. ExecuteCommand methods etc), and the other usually contains business specific methods (eg. UpdateCustomer).

Is this correct? Which is which?

Answer

David Basarab picture David Basarab · Sep 25, 2008

To me this is a personal design decision on how you want to handle your project design. At times data access and data service are one and the same. For .NET and LINQ that is the case.

To me the data service layer is what actually does the call to the database. The data access layer receives the objects and creates them or modify them for the data service layer to make the call to the database.

In my designs the Business Logic Layer manipulates the objects based on the business rules, then passes them to the data access layer which will format them to go into the database or the objects from the database, and the data service layer handles the actual database call.