DEV Community

Discussion on: Unconditional Fizzbuzz: an Object-oriented approach

Collapse
 
efpage profile image
Eckehard

Luckily there are different ways to catch a tiger... If you find other methods more useful, why did you use inheritance then? It is an option, not an obligation.

I´m not sure if I would want to put the database adapter in a parent class. You do not need to inherit something to work with a class. You can just define an interface (for example a messaging system) and ask the database....

But maybe inheritance is a good way to define a messaging system for all your objects (ok, that was already mentioned :-)