18

Over the years I've used various naming conventions for services in my applications

for example:

[ClassName]Service  
[ClassName]Manager  
[ClassName]Factory  
[ClassName]Provider  
[ClassName]Helper

I generally only use the "Helper" suffix for utility classes that have no external dependencies.

However I find that there is a bit of a cross-over between the others, and wondered if there was any recommendations/standards/guidelines on what to use and when?

4
  • I'm not sure you're going to find guidelines on that, except for the obvious one: name your classes by their purpose. Manager, Factory, Provider and Service all mean different things. Your question seems to indicate they're interchangeable, they're not.
    – svick
    Jul 5, 2011 at 20:18
  • @svick, care to elaborate on this in an answer?
    – Ben
    Jul 5, 2011 at 20:37
  • @Ben, I don't know what else to say. Just name your classes, so that it's obvious what they do. And I don't think what I said is worth an answer.
    – svick
    Jul 5, 2011 at 21:06
  • 4
    @svick well you make it sound like its absolutely obvious. I don't think it is. I could have a ProductManager that saves products or a ProductService that saves products. I could have a ConfigurationProvider or a ConfigurationFactory that generates a configuration. This is why I'm asking for an explanation.
    – Ben
    Jul 5, 2011 at 21:45

1 Answer 1

7

MSDN has some advice on Type naming.

I also recommend reading Framework Design Guidelines book for a more detailed discussion on naming and lots of extra design advice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.