Click to See Complete Forum and Search --> : window service vs window application
JenniferBabe
Jun 12th, 2007, 08:03 AM
Hi. I've been thinking about ways in which I could take advantage of window services however in practice I have not been able to. Let's say for e.g. a simple program, running in the background and backing up the database nightly. I originally thought I could implement this as a window service. But then I needed ways to allow the user to input configuration details e.g. directories etc. So I had no choice but to implement it as a hidden window application with a notify icon that had the option to change configuration.
Is there any way I could take advantage of window services for the above program? Most of the implementation could be done as a window service except allowing the user to set and edit the configuration details.
Jennifer.
penagate
Jun 12th, 2007, 08:37 AM
Implement the backup logic as a service and provide an application front-end for the service configuration.
bgmacaw
Jun 12th, 2007, 08:59 AM
The way I do this is to have a separate administrative program that's used to set the configuration information for the service. This data is saved in a serialized data file in the All Users data area for our product. When the configuration is changed, the service is restarted and it reads in the new configuration into its own configuration class and it's ready to go.
If you need something more sophisticated, you can use remoting or other lower level methods to communicate between the desktop app and the service.
JenniferBabe
Jun 15th, 2007, 08:58 AM
Ok I understand. on a different note, let's take that same program that's backing up files nightly. Is there any significant advantage doing this as a service rather than an application without a form and just a notify icon?
Jennifer.
bgmacaw
Jun 15th, 2007, 09:09 AM
The advantage of a service is that nobody needs to be logged on to the system. This is particularly important for processes that run unattended.
JenniferBabe
Jun 15th, 2007, 11:53 AM
Thanks for your response, was very helpful.
Jennifer.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.