0
votes

We are creating a .net web application.

Exposed services (i.e. those consumed by the presentation layer) will be built using WCF and hosted in IIS.

Should we build other Classes (DAL, Business Logic that is not directly exposed, helper classes etc) in a Class Library? If so, how do these get hosted?

Or do we have to use a WCF Service Library?

Or is there a better way?

3
a regular class library is the way to go, (you should already have a bin folder in your service project and the dll will be copied there when you build) - PatFromCanada

3 Answers

0
votes

You can create a service library for your case, and then add the references(dll of the service lib) to a new WCF service application.

Once that is done, publish the WCF service app and host it in IIS.

0
votes

I would question your use of WCF at all.

In process, stuff is much, much faster. By sticking a service boundary between your logic and presentation layer what are you gaining?

0
votes

You haven't really said anything about how much you may need to scale the application over the next 5 years, but my experience is that successful projects tend to more than double in every metric within that timeframe. You probably don't need to immediately implement an out of process service but you should always design your application in anticipation if becoming necessary: if you sort out your logical concerns now, you can sort out physical concerns more easily later. Pay particular attention to the boundary between your MVC controllers and the underlying logic, taking care to minimize the amount of data passed through. You absolutely don't want to leak your underlying schema through, but rather use DTOs. Then when you reach a breaking point around load balancing or distributed caching, you're not painted into a corner.