views:

179

answers:

4

I'm currently trying to design an application and I'm having trouble trying to decide on the architecture to use for it.

This will be a .net application and essentially what this application will have is a server running some specific software that this application will interact with. On this server there needs to be a provisioning service running that will actually interact with this application, queue requests etc. Then there will be a web front end which provides the user interface and communicates with the service, which then communicates with the software, hope that makes sense. This will mean the web interface can be installed on a different machine to the actual software.

So what i'm trying to establish is:

  1. What is the best thing to use on the server running the application, a web service running in IIS, or a Windows Service.
  2. If the provisioning service is a windows service, what is the best way for the asp.net web application to communicate with it.
  3. Are there any patterns or architectures that deal with this sort of setup.
+1  A: 

For your provisioning service, I would use a Windows service that exposes a service interface (API) through WCF. You can then easily expand that to provide a Web Service (SOAP) API or even a REST API. As far as how the web application can communicate, that is really up to how you expose the communication layer (WCF, SOAP, REST) and what you are most comfortable using. I would say that WCF is the easiest to work with if you control both sides of the communication, which it sounds like you do.

I'm not sure what sort of patterns you are looking for. This is a fairly standard n-tier design pattern. There aren't a lot of tools (that I know of at least) that help you create the actual implementation.

Scott Dorman
+4  A: 

Some thoughts/answers:

  1. If you use WCF, you can switch from hosting in IIS or a Windows Service at will. (Just put your main code into a dll, then write a very small wrapper service or web project.)
  2. WCF, definitely. It gives you all sorts of options, TCP, HTTP/Web Services, IPC, peer-to-peer, etc. The only issue is choosing which you'd like, then editing the config file.
  3. It sure looks like I'm recommending WCF, so I guess that's the answer to this question, too.
John Fisher
It definitely seems like WCF is what I need, best read up on that then!
Sam Cogan
+1  A: 

For starters is sounds like you want to look at Windows Communication Foundation, since you will have websites interacting with services and/or applications.

Windows Communication Foundation is a part of the .NET Framework that provides a unified programming model for rapidly building service-oriented applications that communicate across the web and the enterprise.

Neil N
+1  A: 

A windows service that does some work can be installed on a different machine as iis or the same.

You can use an mq (like MSMQ) to send messages from the web app to the service. The service would subscribe to the MQ and be listening for messages. There are a lot of good benefits going this way (guaranteed delivery), but you've got to set it up.

Or you can have the service poll the web app on webservices periodically and when it sees work available for it on the web app get it and then keep the web application updated as to how the work is going.

However for the web application to do push type communication you can use System.Net.Sockets or WCF (put server in your service and client in your web app), but this needs correct firewall configuration to allow the ports you want to speak on be allowed.

gjutras