开发者

WCF as replacement of aspx codbehind in asp.net web application

I am new to WCF but have been working on asmx services for a while.

We have an effort underway where we want to introduce a service layer between our UI/aspx pages and Database Layer. Most of the business logic exists in codebehind. So the current setup is UI/aspx->DAL->Database. We want to do UI/aspx.vb->WCF->Business Layer->DAL->Database i.e by moving everything from codebehind in WCF开发者_运维百科...Is this a good approach?

Our future goal is to get the flexbility in replacing business layer, so there is no dependency between UI and business layer or database.

Need some guidance on how we can use WCF in right way to do layered architecture approach..

Your help is much appreciated.

Thanks.


In principle service layers are a good idea but if you're simply introducing one for the sake of it then it's a lot of effort for no return.

The main benefit you will get from a service layer is that you will have a lot more flexibility in the type of clients you can connect to it. At the moment it's likely that the only application that can use your DAL is your ASP.Net app by adding a service layer and exposing it using WCF end points you'll have the option of connecting other SOAP or REST clients which is a good thing for future enhancement.

However if you're only ever planning on using your DAL with your existing ASP.Net app then there's no guarantee that you will gain anything and in fact could make your life harder by adding a service layer. If you do all your data retrieval server-side, i.e. don't use AJAX, then a service layer would be pretty pointless.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜