开发者

NET Service Solution

开发者 https://www.devze.com 2023-03-20 15:26 出处:网络
I want to make an application that separate interface, business process and database. The idea is开发者_如何学Python I want to reuse business process and database part in different interface.

I want to make an application that separate interface, business process and database.

The idea is开发者_如何学Python I want to reuse business process and database part in different interface.

for quick example...

In the first project, I use Silverlight as my interface In the second project, I want to use WPF In the third project, I want to use ASP NET (All is .NET technology and same application)

Can anyone tell me what should I use for business process part, so I can reuse the business process part in all project?


Write your middle tier using webservices

WCF or .asmx 

you can call webservices from all kind of UI you are looking for


You can create a dll named "BusinessLogic.dll" which contain all your business logic code and reference this dll in all projects


For the business layer, I would recommend WCF (since all the UI's are .NET, this gives you the most flexibility). You can do this one of two ways:

  1. A WCF Class library (essentially a WCF DLL)
  2. A WCF Class library or application that sits on top of an old fashioned DLL. This would enable you to use the business logic directly in an application, but I think #1 is the best route to go.

You can do something similar for the data access layer, as well, or you can simply implement the data access layer as a DLL that is directly referenced (with no intervening WCF/Web Service) by the business layer. However, using WCF to access the data layer gives you some flexibility in terms of not having to physically co-locate the business layer and data layer.

You will also, more than likely, discover that some classes can be used by multiple layers during your design and development. I generally put those into a separate assembly, and reference it as needed in the various layers to prevent writing the same code over and over.

0

精彩评论

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