Tips::Favor Composition Over Inheritance is not a Universal Mantra!!

 


"Composition and Inheritance are the atoms of Pure OOO design.

One can't be replaced by others. Two have their own purpose,  Most of the time developers use Inheritance in the wrong way and it looks  Composition is the better option. 

One of the signs of using Inheritance the wrong way if you suppress a parent method by throwing "not implemented exception" or by silent/empty implementation.

To restrict that silly mistakes, Seniors often giving the above mantras without thinking about the context, but it does not fit always."

To know in detail please follow#javaOnFly , we will publish an article soon!!!


javaOnFly started a new segment called Tips corner, every Saturday we will post Tips only for you to make you a better programmer.


If you Like the Tips want more about the topic , you can read a whole bunch of detailed Java Articles on javaOnFly, if you like the content, you can subscribe to javaonfly.


Still not Satisfied!!! I love to discuss with enthusiastic people like you, on Java, Patterns, Microservice, clean code latest Trends, I am just one click away from you to connect


Follow me on

javaonfly :: https://javaonfly.blogspot.com

Twitter :: https://twitter.com/Shami83

Linked In :: https://www.linkedin.com/in/shamik-mitra-05b66227/

Instagram :: https://www.instagram.com/shamik.mitra/

Dzone :: https://dzone.com/users/1211805/mitrashamik.html

Facebook Group :: https://www.facebook.com/groups/javachamp

FaceBook Page :: https://www.facebook.com/artofjavaprog


#java #javaOnFly #code #programming #cleancode #javaonfly

#ask2shamik #tips #composition #inheritence #oops

Post a Comment