To Service or not to Service
-
Hi all, I am currently writing a program that will be running on an XP-embedded machine that will act as a watchdog and launcher of another application. Naturally, since this needs to be persistent on the machine, it makes since to write it as a windows service. However, I'm not sure what benefits this will have over a standard application because I have not had a great deal of experience writing services. For one, these machines will never be touched by end-users so an application running in the taskbar would not have the problem of an accidental closure or user error. Two, this program may require relatively constant communication with the application it opens and know if it dies so it can report back to a central server, as well as status update to said server. So I guess my overall question is are there any caveats to writing this as a windows service? Is there any performance gain or loss when it comes to messaging between the applications? Any opinions and thought are greatly appreciated. Thanks, Dustin
-
Hi all, I am currently writing a program that will be running on an XP-embedded machine that will act as a watchdog and launcher of another application. Naturally, since this needs to be persistent on the machine, it makes since to write it as a windows service. However, I'm not sure what benefits this will have over a standard application because I have not had a great deal of experience writing services. For one, these machines will never be touched by end-users so an application running in the taskbar would not have the problem of an accidental closure or user error. Two, this program may require relatively constant communication with the application it opens and know if it dies so it can report back to a central server, as well as status update to said server. So I guess my overall question is are there any caveats to writing this as a windows service? Is there any performance gain or loss when it comes to messaging between the applications? Any opinions and thought are greatly appreciated. Thanks, Dustin
I work on XPe and we do everything quite deliberately as applications, not services. The only real benefit a service has is the built in ability to be restarted by the service manager. Our solution is make sure our "services" don't crash. (Some of our services can't really be restarted anyway On the negative side, services are annoying to debug (when problems happen when in service mode) and maintain in an XPe environment. In our case, we push down updates, the machine reboots and the updates are xcopy installed. Can't do this with services.
Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
-
I work on XPe and we do everything quite deliberately as applications, not services. The only real benefit a service has is the built in ability to be restarted by the service manager. Our solution is make sure our "services" don't crash. (Some of our services can't really be restarted anyway On the negative side, services are annoying to debug (when problems happen when in service mode) and maintain in an XPe environment. In our case, we push down updates, the machine reboots and the updates are xcopy installed. Can't do this with services.
Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
Thanks Joe, that is very informative and helpful. We actually just had another meeting about it and I believe we are turning away from the service idea. Thanks, Dustin