( Object Oriented Designs )
S = Single Responsibility Principle
O = Opened Closed Principle
L = Liscov Substitution Principle
I = Interface Segregation Principle
D = Dependency Inversion Principle
You mush have Object Oriented Design because
# Of course, object oriented.
# Re-usable
# Can be changed with minimal effort.
# Can be extended without changing existing codes.
HERE ARE BASIC DEFINITION OF SOLID
1. Single Responsibility Principle
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYI4ITsPd1dxhYc9gwvkHqn32D0cRf6Mqx6kpZnUs5fgrHvQ5VKZ72XCvzw-0x3G9Y1XjDNqvXbXdxCRfXZnTVkOwYyYCudUS_8HOJ0OpkXGEDzbvvmh_YVyoRN8QKnxiADcpNIz-_LK4/s320/dggn8fwf_24f6dgv5dq_b.jpeg)
Single Responsibility Principle defines :
“THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO CHANGE.”
2. Opened Closed Principle
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7bJyepsX438-QCfgZOaAEZ2CuU_R48b484jc50rrKBZm8S4t0ok5h7erQ0HDa-7ccH6LjxE3QSiTV1waCglrdHSGHddELa5fNaLj6b5CuWDnGuVExS6RUO6cz-Jz2viyDeNt23I5qhno/s320/dggn8fwf_26f24cwpgj_b.jpeg)
Opened Closed Principle defines :
“SOFTWARE ENTITIES (CLASSES, MODULES, FUNCTIONS, ETC.) SHOULD BE OPEN FOR EXTENSION, BUT CLOSED FOR MODIFICATION.”
3. Liscov Substitution Principle
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyF8Rdp9JP1WPY6X6O-ds_z6z2iHYqP201fQOQ5XeOWWKl5ZgV11osdNf8CjfRus8reA53zPZVPOPuYJrtpQ-QPT8dsefkzij1T5Bt2P-FZibNupuvgGtZQpuX13buEc7je7C6h0OR718/s320/dggn8fwf_29gk8qdx45_b.jpeg)
Liscov Substitution Principle defines :
“SUBTYPES MUST BE SUBSTITUTABLE FOR THEIR BASE TYPES”
4 . Interface Segregation Principle
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPwZahtyRklyt4I2e0hnNKKl0Lcghku_SbO-qkT95B2-hs_QPyafv_e2kdQVzxhEkzRAtxiLzs6zNmSy8o5BuoSD-MfNdJaCJMEVJOrj3aypINHcHBFJVh5OOSCOcYDsn8LLLanTMFqgo/s320/dggn8fwf_33cq6mtncq_b.jpeg)
Interface Segregation Principle defines :
“CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DO NOT USE.”
5. Dependency Inversion Principle
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrF2fhvIZphMcC4QFAa0Dbk3pDRyypwI5pheBQ_gbkTUfgVAJAb53MIgCBkUKw_jwPZWroOhJyvqVO-xlPlgsYMvvNvV4-zIpVe-7PBEFtXjfwopCaVzakEOpxzAtpSHNFN_owduuJwlk/s320/dggn8fwf_36gttf6dtd_b.jpeg)
Dependency Inversion Principle defines :
“HIGH LEVEL MODULES SHOULD NOT DEPEND UPON LOW LEVEL MODULES. RATHER, BOTH SHOULD DEPEND UPON ABSTRACTIONS.”
There are several kind of Object Oriented Principles such as ---
1. Composition over Inheritance : This says about favoring composition over inheritance.
2. Principle of least knowledge : This says the less your class knows, the better.
3. The Common Closure Principle : This says related classes should be package together
4. The Stable Abstractions Principle : This says the more stable a class is, the more it must consist of abstract class.
No comments:
Post a Comment