In the System.Data.Entity
namespace there's the DbFunctions
class. It has nearly 100 functions that handle string manipulation, DateTime calculations, and statistical functions. There are a lot of SRP questions on SO, so feel this is the appropriate forum. Wikipedia
defines SRP as follows:
The single responsibility principle states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility
It seems to me that DbFunctions is a violator.
When defining what a class's purpose is many people advocate counting the number of "ands" you use in the definition. More than one and you may be in violation of the SRP. By my count, there are at least 3 in DbFunctions
. Is my understanding of SRP flawed or too literal? I know there are always edge-cases, but this, in my mind, seems like it violates SRP. This certainly doesn't diminish the ultra-usefulness of the class.
Does this class conform to SRP?