rain1024 / gVim-Pathogen

My Coding Life
http://rain1024.github.io/gVim-Pathogen
2 stars 0 forks source link

SOLID #21

Open rain1024 opened 10 years ago

rain1024 commented 10 years ago

Single-Responsibility Principle (SRP)

A class should have only one reason to change.

Open-Closed Principle (OCP)

Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.

Patterns: Strategy

Liskov Substitution Principle (LSP)

Subtypes must be substitutable for their base types

Interface Segregation Principle (ISP)

This principle deals with the disadvantages of "fat" interfaces. Classes whose interfaces are not cohesive have "fat" interfaces. In other words, the interfaces of the class can be broken up into groups of methods. Each group serves a different set of clients. Thus, some clients use one group of methods, and other clients use the other groups.

Dependency-Inversion Principle (DIP)

High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.

Reference

Martin, Robert C., and Micah Martin. Agile principles, patterns, and practices in C. Upper Saddle River, NJ: Prentice Hall, 2007. Print.