To Wrap or Not to Wrap: Wrapping Data Access in a Service Facade

Posted by PureCognition on Stack Overflow See other posts from Stack Overflow or by PureCognition
Published on 2010-05-11T15:04:11Z Indexed on 2010/05/11 15:14 UTC
Read the original article Hit count: 295

For a while now, my team and I have been wrapping our data access layer in a web service facade (using WCF) and calling it from the business logic layer. Meanwhile, we could simply use the repository pattern where the business logic layer consumes the data access layer locally through an interface, and at any point in time, we can switch things out for it to hit a service instead (if necessary).

The question is: When is it a good time to wrap the data access layer in a service facade and when isn't it? Right now, it seems like the main advantage is that other applications can consume the service, but if they are internal applications written in .NET then they can just consume the .NET assembly instead. Are there other advantages of having the DAL be wrapped in a service that I am unaware of?

© Stack Overflow or respective owner

Related posts about n-tier-architecture

Related posts about object-oriented-design