Favor composition over inheritance.

Master and Student…

Master: Grasshopper, tell me what you have learned of the Object-Oriented ways.

Student: Master, I have learned that the promise of the object-oriented way is reuse.

Master: Grasshopper, continue…

Student: Master, through inheritance all good things may be reused and so we come to drastically cut development time like we swiftly cut bamboo in the woods.

Master: Grasshopper, is more time spent on code before or after development is complete?

Student: The answer is after, Master. We always spend more time maintaining and changing software than on initial development.

Master: So Grasshopper, should effort go into reuse above maintainability and extensibility?

Student: Master, I believe that there is truth in this.

Master: I can see that you still have much to learn. I would like for you to go and meditate on inheritance further. As you’ve seen, inheritance has its problems, and there are other ways of achieving reuse.

====

This quote comes from Head First Design Patterns, I personally favor composition over inheritance.

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Gabriel Ajabahian
Software Engineer Freelance
I am a Freelance consultant, I’m passionate about creating dynamic applications. With 10+ years technical experience as well as working on major application systems for top down.

I have extensive software engineering experience, recently I focus on Scala/Java and JavaScript. On the other hand, I have experience with C# and .net framework/core. I focus on integrating applications that are built against different frameworks and can run on different platforms.

Scalability, efficiency and performance are key topics for any software, that’s why I keep track of the newest technologies, I never underestimate the power of the cloud, that’s why I do believe in using this power with “edge applications” to expand software’s and solutions to a new level.

Being a software engineer who understand the business as well as my team, looking at things from different perspectives. Being open and honest and investing in relationship makes a big difference.

Specialties: Software development, Scrum/Agile, Process and Problem management.