What are common Windows service design patterns?

Where can I find good information about common design patterns that can be used to create a new Windows service?

** Update: I ask if there are general schemes that are used to build the service. *

For example: I saw how one task was executed on a timer (this seems very common when building a service). I also saw work queues being deployed as services. Are there other general design patterns for developing software to run as a service?

+7
windows design-patterns windows-services
source share
1 answer

A Windows service is just a background process that is not tied to an interactive desktop (although it can additionally communicate with it). The use of such a concept is many and varied. General use of the service (not mutually exclusive):

  • Listen to the incoming request from another place (for example, TCP, RPC, COM, HTTP) and act on it.
  • Schedule a task at a specific time, at certain intervals, or when some other condition becomes true, for example, viewing a file system.

The only template that I can think of that you should apply to all your services is: Separate the part that decides when to do the work from the part that does this work. This will facilitate the use of unit test and the reuse of various parts.

+9
source share

All Articles