5 principles of Object Oriented Class Design

  1. SRP (The Single Responsibility Principle): A class should have one, and only one, reason to change.
  2. OCP (The Open Closed Principle): You should be able to extend a classe’s behavior, without modifying it.
  3. LSP (The Liskov Substitution Principle): Derived classes must be substitutable for their base classes.
  4. DIP (The Dependency Inversion Principle): Depend on abstractions, not on concretions.
  5. ISP (The Interface Segregation Principle): Make fine grained interfaces that are client specific.

And 2 extra ‘guidelines‘ that is actually from procedural programming, but still applies to methods:

  1. One point of return: The function or method should only return a result at 1 location in the code, at the end of the function/method.
  2. Only one functionality: A single function or method should only have 1 functionality. In case it has more than 1, it should be split up.

[Via: ButUncleBob.com]