The S.O.L.I.D Principles
These five software rules help make software easier to grow and keep in good shape. They were made popular by a software engineer, Robert C. Martin.
S — Single Responsibility
A class should have a single responsibility
O — Open-Closed
Classes should be open for extension, but closed for modification
L — Liskov Substitution
If S is like T, you can swap T with S without messing up the program's qualities.
I — Interface Segregation
Clients should not be forced to depend on methods that they do not use.
D — Dependency Inversion
High-level modules should not depend on low-level modules. Both should depend on the abstraction. Abstractions should not depend on details. Details should depend on abstractions.
Summary
We've talked about these five rules and why they matter. They make your code flexible, expandable, and easy to test.
Thanks for reading! I hope you found this helpful and enjoyed it as much as I did writing it. If you have questions or ideas, please leave a comment.
?? Senior .NET Engineer ? Contractor ? Freelancer | Implementing clean, maintainable and scalable web apps
11 个月Found a similar article here: https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898