Encapsulate a data access layer with WCF or WCF Data Services
Are ther开发者_StackOverflow社区e scenarios where it makes sense to encapsulate a data access layer (of a ASP.NET webapplication) with WCF or WCF Data Services ? Makes it sense to use a Service inside the application ?
Yes.
Any time you need to provide data access to remote client applications (other than your website).
For instance, if you want to provide an API for your web application so that developers can integrate your application with others in new/interesting ways.
Certainly!
If you're using something like the Entity Framework as your data/entity layer, WCF Data Services can be a good option for exposing data and functionality to your remote clients.
If you want a web application to make AJAX calls to your server, having WCF Services within your web application can also be a good solution.
It really depends on what you want to do, how complex the application is, and the usage that you forsee for that application.
精彩评论