Child Focused Classes

The Idea!

Object Oriented Programming comes up with a lot of debt – among these, main is how to manage level of inheritance. While it is commonly seen, some classes are parents of others but both parent and child classes are complete class on their own. This will create a mess before you know it. One such place is in models when one table represents more than one type of Entity which is called Single Table Inheritance (STI). For instance, consider an STI for relation between products and tags and orders and tags.

Continue Reading

INHERITANCE VS COMPOSITION

The Confusion because more is Known

Today I was caught in a crossfire in an argument about inheritance and composition. In OOPs, world I am relatively new so I learned something new today. As a child, when I used to play video games (Tekken 3) I try to use every action I know which caused me to bite the dust in 4 in 5 games. Same is happening here, more I know the OOPs, more I use it wrongly.

Continue Reading