n-Tier Application Architecture question

W

Will

Hi all. I'm beginning to think about how to write a new app at work.
I'd like to design the app with scalability concerns addressed.
We run SQL server for the data tier.
I'd like to create some kind of middle tier that would hold the
business logic for the app.
I'd like to be able to design seperate presentation layers that would
talk to the middle tier. I know my app is going to have people
accesing it over our intranet using Internet Explorer, and I'll have
people using it via a winforms application.
Until now, the only developement I've done is where the UI tier and
the buisness logic tier are in the same project and application. How,
using Visual Studio, do I create the two seperate layers and have them
talk to each other? Does the middle layer need to be a web service
project?
Any help or references is appreciated.
 
N

Nicholas Paldino [.NET/C# MVP]

Will,

The web layer doesn't need to be a web-service project, and to be
honest, I don't think that it should be unless you are doing a number of
stateless calls. If you require to maintain state between calls, then I
think that you should look at remoting instead or perhaps a proxy through
COM+.

You will need to have separate projects, obviously. I think that the
best way to do this would be to generate your classes on the business layer
using COM+ (deriving from ServicedComponent), which also would provide
transactioning and other services to you.

Additionally, you should create interfaces that the serviced components
(or remoted, if you go that way) implement, and then have those interfaces
installed on the client machines (either the web server or the windows forms
client machines), which would access the serviced components. You don't
need to pass the implmentation around to all of the clients and you can just
work through proxies. I recommend this because for the number of people
using this shared functionality, if you design the interfaces right, you can
reduce your distribution woes by not having to change the interfaces, but
the implmentation in only a few places (however many app servers are hosting
the business objects).

Hope this helps.
 
W

Will

Thanks, Nicholas. I've heard people talk about remoting, but I've
never understood that this is one of the "things" you use it for. I've
got direction now. Thanks for the help.
Nicholas Paldino said:
Will,

The web layer doesn't need to be a web-service project, and to be
honest, I don't think that it should be unless you are doing a number of
stateless calls. If you require to maintain state between calls, then I
think that you should look at remoting instead or perhaps a proxy through
COM+.

You will need to have separate projects, obviously. I think that the
best way to do this would be to generate your classes on the business layer
using COM+ (deriving from ServicedComponent), which also would provide
transactioning and other services to you.

Additionally, you should create interfaces that the serviced components
(or remoted, if you go that way) implement, and then have those interfaces
installed on the client machines (either the web server or the windows forms
client machines), which would access the serviced components. You don't
need to pass the implmentation around to all of the clients and you can just
work through proxies. I recommend this because for the number of people
using this shared functionality, if you design the interfaces right, you can
reduce your distribution woes by not having to change the interfaces, but
the implmentation in only a few places (however many app servers are hosting
the business objects).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Will said:
Hi all. I'm beginning to think about how to write a new app at work.
I'd like to design the app with scalability concerns addressed.
We run SQL server for the data tier.
I'd like to create some kind of middle tier that would hold the
business logic for the app.
I'd like to be able to design seperate presentation layers that would
talk to the middle tier. I know my app is going to have people
accesing it over our intranet using Internet Explorer, and I'll have
people using it via a winforms application.
Until now, the only developement I've done is where the UI tier and
the buisness logic tier are in the same project and application. How,
using Visual Studio, do I create the two seperate layers and have them
talk to each other? Does the middle layer need to be a web service
project?
Any help or references is appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top