I am separating one of my method extension classes (i.e., StringExtensions) into regions, as has become confusing and it's difficult to see the wood for the trees. I have grouped the methods into four regions, as follows:
Identification: Usually associated with the verb to be, e.g., Is, Has, etc., and returns a Boolean. These are mainly used in validation.
Selection: Filters from a collection passed in or replaces what is passed in with empty or null, with no other manipulation
Conversion: Different type is returned to the one entered, without any manipulation or calculation.
Substitution: Returns a manipulation or calculation of what is passed, where the manipulation involves more than replacing with an empty string or null.
I've looked around and found little on the subject. So, I was wondering if there is an already existing concept of grouping methods, as these work for most cases but aren't mutually exclusive. Please could you suggest mutually exclusive groups for String Extension methods?
EDIT: I don't want to subdivide separate namespaces or classes as this extension method class is already used by many applications and would introduce breaking changes.
#region
directive? Or in some colloquial sense? And what do you mean by "mutually exclusive?" You can only have one method with a particular signature. Is this for source code management, for shortening the intellisense list, for deployment purposes, what? Please explain your need in technical terms, or provide an example.#region
can be pretty much unlimited in size. Are you asking us what region names would comprise four orthogonal logical groups? Without seeing the list of methods or knowing what they do? Are you asking for a naming convention?