Rename the ServiceManager class
After Alan Green's " Naming Java Classes Without a Manager " I started looking * for manager classes in my own code.
How would you rename the following class? Maybe a ServiceLoader? but it doesn't "download" anything from anywhere.
class ServiceManager
{
public bool IsRunning { get; };
public void Start();
public void Restart();
public void Stop();
}
Also, share your examples of manager classes you renamed.
thank
I should probably describe a little more of what the class does. This class starts / stops the .NET Remoting service.
The Start () method registers a channel (port) and interfaces for services.
source to share
Does the manager part add anything? Why not just "Service".
edit:
To clarify this, it looks like it doesn't manage, control, or do anything for the service. It reads as if it were a service.
If it was doing anything for or for the service, then I would expect to be able to get the managed service object and call methods on that.
If it was a controller interface that you could get from a service object, it would be different.
source to share
While this article is relevant, I don't see an issue with the ServiceManager name
The service works as well, but perhaps you need to be more specific - in the namespace. It looks like a Windows / NT service, so maybe just a Service in your own descriptive namespace.
Thinking more about it - just the old service seems to be the most appropriate. with a namespace of your choice.
source to share
If it is the service class itself, I would rename the descriptive type of service provided, i.e. BookingService, OrderProcessingService, PrintAccountingService. If it is a generic class that manages different types of services, then I would assume a ServiceController or ServiceManager is appropriate. Since you prefer not to use a dispatcher, I'd go with the first one.
What are you going to do if someone writes an article that says you should get rid of all the "Controller" class names? Bottom, line - The name of the class should help you understand what the class is doing. If it's already working, you don't need to rename to meet someone else.
source to share