-
๐ฆ๐ถ๐ป๐ด๐น๐ฒ ๐ฅ๐ฒ๐๐ฝ๐ผ๐ป๐๐ถ๐ฏ๐ถ๐น๐ถ๐๐ ๐ฃ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ (๐ฆ๐ฅ๐ฃ) - A class should have only one reason to change. This means that a class should have a single, well-defined responsibility and that responsibility should be entirely encapsulated by the class.
-
๐ข๐ฝ๐ฒ๐ป/๐๐น๐ผ๐๐ฒ๐ฑ ๐ฃ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ (๐ข๐๐ฃ) - Software entities (classes, functions, etc.) should be open for extension but closed for modification. This means that you should be able to add new functionality to a class without changing its existing code, but you should not need to modify the class itself to do so.
-
๐๐ถ๐๐ธ๐ผ๐ ๐ฆ๐๐ฏ๐๐๐ถ๐๐๐๐ถ๐ผ๐ป ๐ฃ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ (๐๐ฆ๐ฃ) - Subtypes must be substitutable for their base types. In other words, if a class is derived from another class, you should be able to use the derived class in the same way as the base class without any issues.
-
๐๐ป๐๐ฒ๐ฟ๐ณ๐ฎ๐ฐ๐ฒ ๐ฆ๐ฒ๐ด๐ฟ๐ฒ๐ด๐ฎ๐๐ถ๐ผ๐ป ๐ฃ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ (๐๐ฆ๐ฃ) - Clients should not be forced to depend on interfaces they do not use. This means that you should design your interfaces to be as specific and focused as possible.
-
๐๐ฒ๐ฝ๐ฒ๐ป๐ฑ๐ฒ๐ป๐ฐ๐ ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ผ๐ป ๐ฃ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ (๐๐๐ฃ) - High-level modules should not depend on low-level modules. Both should depend on abstractions. This means that you should design your software so that high-level modules depend on abstractions rather than concrete implementations.
Created
December 18, 2022 08:17
-
-
Save boubkhaled/f772bbc6b08781851c20b7e62b4ae614 to your computer and use it in GitHub Desktop.
SOLID-Principles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
