views:

162

answers:

2

. Hi, We are building an ASP.NET application (with C#.net as language) and will be hosting on Windows Server 2003 Operating System with MS SQL Server 2008 as database.

Here I need a clarification.

The main project contains Web Application Project and few other projects such as PeriodicEmailing Service Project (A service which send emails to registered users on a periodic basis).

In case of web application project we have UI, business and database layers. In case of PeriodicEmailing Service project we need to perform some business and database functions.

So now my doubt is that … While designing PeriodicEmailing Service Project (as a best practice) do we need to implement the new business and database functions in the web application project’s business and database layers or explicit business and database layers to be designed with this PeriodicEmailing Service project itself?

Thank you for your time and your help will be greatly appreciated.

Many Thanks, Regards, Venkat. .

+2  A: 

If i understand what you're asking correctly, you could compile your business and data layer into separate assembly. This way both your website and your service can reference them without duplicating your DAL code.

Sergey
A: 

Try to use existing Business Layer and Data Access Layer. If you need to add new logic, add it to your existing libraries.

That's why we use separate layers. You'll get advantage of existing code, and in future, it'll be easier to maintain your both applications.

Canavar