Pulathisi Bandara
Pulathisi Bandara

Reputation: 98

Windows service implementation most suitable practice?

What is the most suitable? windows service to be implemented as a separate abstract class and reuse it when you need to create a service application or directly create a windows service outside of a class(C style) which is in the CodeProject.

Upvotes: 0

Views: 63

Answers (1)

Superlokkus
Superlokkus

Reputation: 5069

Depends on your application: I wouldn't use the CodeProject example when you got to ensure that many modules are"loaded" before you "work" or if it's important to check from time to time that you really run, have to do critical or very complex work at shutdown et cetera et cetera... To sum up: If you have to interact often or complex with the service control environment, I would write a nice wrapper class (to be honest at the moment I mixed the C and C++ code, but I will refactor it).

Only if you write a "run forever until I kill you" I would write code like in your example.

Upvotes: 1

Related Questions