Results 1 to 6 of 6

Thread: window service vs window application

  1. #1

    Thread Starter
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    window service vs window application

    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.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: window service vs window application

    Implement the backup logic as a service and provide an application front-end for the service configuration.

  3. #3
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: window service vs window application

    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.

  4. #4

    Thread Starter
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: window service vs window application

    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.

  5. #5
    Fanatic Member bgmacaw's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, GA USA
    Posts
    524

    Re: window service vs window application

    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.

  6. #6

    Thread Starter
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: window service vs window application

    Thanks for your response, was very helpful.

    Jennifer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width