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.

+1


source to share


6 answers


Maybe a ServiceController? ServiceWrapper?



+1


source


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.

+5


source


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.

+1


source


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.

+1


source


  • ServiceMonitor?
  • ServiceController?
0


source


This class starts / stops .NET. Remote service.

Then I would call it DotNETRemotingService ...

Technically, it's a wrapper around this service ... but then, for all intents and purposes, within your code, it's an IS service and therefore deserves to be handled as such.

0


source







All Articles