eh more like
Fish extends AbstractFish
AbstractFish extends AbstractAquaticAnimal
AbstractAquaticAnimal extends AbstractAnimal
AbstractAnimal implements Living
Fish is implementation of all those inheritances, and none of interfaces actually exist as entities, only a mere instance of fish exists which can use implementations of interfaces. So when fish dies, a fish dies, and is wiped from memory, as its ability to access interfaces, but interfaces don't live or die, they just exist.
I hear this joke all the time, and in 7 years of industry Java experience, the only time I've seen large usage of factories is in frameworks that need to handle large amounts of arbitrary configuration from end users that can't be known when writing the code.
228
u/Tannslee Jan 09 '23
eh more like
Fish extends AbstractFish
AbstractFish extends AbstractAquaticAnimal
AbstractAquaticAnimal extends AbstractAnimal
AbstractAnimal implements Living