I am designing a piece of software that needs to operate different pieces of hardware based mainly on a schedule but it also needs to have a web interface for configuring settings, configuring the schedule, and possibly even manually controlling the hardware. I'm not sure how to design the architecture of software like this.
One thought that I have had was to create a Windows service that does the communication with the hardware as well as "publishing" web services through WCF and then having an ASP.NET application that then controls the Windows service through WCF. This approach seems to be a lot of work for what I'm trying to accomplish.
Could someone please give me some direction whether or not this is a good approach, and even give me a better way to do it if one exists?
Thanks! Joel
. NET Framework is an object oriented programming framework meant to be used with languages that it provides bindings for. Since C is not an object oriented language it wouldn't make sense to use it with the framework.
C# and Visual Basic are programming languages designed for creating a variety of applications that run on . NET.
You can instantiate a WCF endpoint as a TCP service from within the Windows service, as explained on MSDN: How to: Host WCF in a Windows Service Using TCP .
From there, it is relatively straightforward to consume that endpoint in an ASP.NET application (same as consuming any other WCF endpoint).
In the absence of any compelling reasons to do otherwise, this is probably the approach I would take. Your only other option is to use some other form of IPC, such as memory-mapped files or named pipes. WCF is a lot easier to get up and running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With