Principle of software design - SOLID

Single Responsibility Principle

A class should have responsibility over a single part of the functionality, and that functionality should be entirely encapsulated by the class

Open-Closed Principle

Entities should be open for extension but closed for modification. That would make classes extensible without changing the implementation

Liskov Substitution Principle

Subtypes should be substitutable for their super type without breaking clients. As the hierarchy goes down:

Interface Segregation Principle

Clients should not be forced to depend on interface they do not use, like a Drawable interface should not require object to implement click() or move(), but just draw()

Dependency Inversion Principle

High-level modules should not depend on low-level modules directly, and both should depend on an abstraction.

Design Patterns