While coding anything remotely useful, I inevitably find myself wanting to add methods to perform smaller bits and pieces. (It could be a method to return everything in a string to the left of the first occurence of a particular character.) Over time, writing such methods will propably form into some kind of library.
What should we name such classes, or how should they be structured? The string method mentioned earlier should probably be in a class called "String something", but I think using suffixes like Utils, Helper, Manager, or Service only makes the name longer without adding real meaning. The name "StringMethods" isn't much better.
So how can we do organize and name our "helper" methods in a sensible way? Has anyone succeeded in doing this?
Best Answer
Naming
Structure
Extension Methods
As suggested by @BenCottrell, is a good idea too.
string
class for example will be available for all string objects everywhere. Namespacing emphasizes the extension's intended use for its intended targets.Extension Methods vis-a-vis Helper Classes