Aviva C# Coding Guidelines is an awesome reference for best practices while coding in C#.
In this blog we will study a sample of how to and not to write coding conforming to the rule – A class or interface should have a single purpose.
By definition, rule AV1000 says,
A class or interface should have a single purpose within the system it participates in. In general, a class is either representing a primitive type like an email or ISBN number, an abstraction of some business concept, a plain data structure or responsible for orchestrating the interaction between other classes. It is never a combination of those. This rule is widely known as the Single Responsibility Principle, one of the SOLID principles.
Tip A class with the word And in it is an obvious violation of this rule.Tip Use Design Patterns to communicate the intent of a class. If you can’t assign a single design pattern to a class, chances are that it is doing more than one thing.Note If you create a class representing a primitive type you can greatly simplify it usage by making it immutable.