开发者

wcf with asp.NET application

What is the best experience of combining wcf services in an asp.NET 开发者_开发百科application?

Should I add wcf services files to the asp.NET project?

Should I create a separate project for the wcf services and refer somehow to them in the asp.NET application?


I presume you have an ASP.NET application that also hosts a few WCF services that can be accessed from the client. There is nothing wrong with this and it works perfectly well.

The three things you should consider doing are:

  1. separate the interfaces for the WCF services into their own assembly
  2. keep the data objects that you use in yet another assembly
  3. separate the implementation of the interfaces into their own assembly

This may seem like overkill, and it's not always necessary to do it this way, but i would do at least steps 1 & 2. Keeping the data objects and contracts (interfaces) in their own separate assemblies is important as it helps when sharing (referencing) the data objects from different projects (i.e. if you have a Silverlight or Windows Forms/WPF client that can consume those assemblies).

Separating out the implementation (step 3) is good, but not the most important thing to do. If you do follow this step, you can still publish the WCF endpoints through your ASP.NET application.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜