Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm working on a middle-tier project which encapsulates the business logic (uses a DAL layer, and serves a web application server [ASP.net]) of a product deployed in a LAN. The BL serves as a bunch of services and data objects that are invoked upon user action.

At present times, the DAL acts as a separate application whereas the BL uses it, but is consumed by the web application as a DLL. Both the DAL and the web application are deployed on different servers inside organization, and since the BL DLL is consumed by the web application, it resides in the same server.

The worst thing about exposing the BL as a DLL is that we lost track with what we expose. Deployment is not such a big issue since mostly, product versions are deployed together.

Would you recommend migrating from DLL to WCF service? If so, why? Do you know anyone who had a similar experience?

share|improve this question
3  
Please don't cross post the same question on multiple sites - webapps.stackexchange.com/questions/21369/… - if you get the wrong site the question can be migrated. –  ChrisF Nov 27 '11 at 0:31
    
@ChrisF I think you meant to put the link for the StackOverflow question there... stackoverflow.com/questions/8274408/exposing-bi-as-wcf-service – Yannis Rizos –  Yannis Rizos Nov 27 '11 at 4:00
    
@YannisRizos - oops :) - I actually meant the web app version. –  ChrisF Nov 27 '11 at 16:40

2 Answers 2

up vote 1 down vote accepted

The main question to ask yourself is Why Should I (as in what would I gain by) adding WCF to my project. You would gain scalability, but at the cost of increase complexity. Do you need scalability? Flexibility in deployments (different layers can more easily be on different development schedules) is another benefit, but you mentioned that it was a low priority.

I am currently working in an environment with C# WebParts hitting Java WebServices, We have fought back and forth about versioning, tight and loose coupling, APIs, and more, but we always focus on ROI. How much will this architecture change cost over the life cycle of the project, versus how much will we save in maintenance and development cost.

I would say do it. You can add your WCF Service on the same machine that is currently running your web. I believe separation of concerns, flexibility, and scalability would be worth it, as the change should be minimally invasive.

share|improve this answer

My recommendation would be to move the business logic onto the same server that has the data access layer, then exposed the business logic as web services using WCF. The web user interface would then make use of the business logic by interacting with the services.

Therefore my answer is yes to your question, I would recommend to migrated from DLL to WCF service.

In some sense you can look at the web application as the presentation layer. The presentation layer and the business logic are two different layers. Of course you can deploy both on the same host. However, in most cases you are better off to deploy business logic and data access on the same host.

I would go even one step further and recommend assessing whether you have a need to expose the data access layer (DAL) via services. If you don't then combining both the data access layer and the business logic into a set of services may be beneficial.

Conceptually a service encapsulates its data and therefore the data access would be an internal detail of a particular service. Equally a service offers pieces of business logic. Therefore creating vertical slices of functionality covering both the business logic and the data access for each slice in a separate service often gives a good level of granularity and modularization.

Of course you may have additional factors that may influence your choices.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.