The simple answer is of course to include a start method on the Service interface.
interface Service {
void start();
OperationResult operation( parameters );
...
}
This of course sux because most users of the Service don't want or care about starting the service they just want to use methods like operation.
How would you solve this problem? I have a simple solution which does have one major limitation without polluting the Service interface thus I would like to hear of peoples proposals.
If it's necessary to start a service, then do stuff with it, and then perhaps terminate the service, there should be an object whose function is simply to start the service and supply an object which may then be used to do stuff with the service, including terminate it (the latter action--probably best handled via IDisposable--should invalidate the "do-stuff" object).