Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>You can do multiple inheritance of interfaces.
Technically correct. But the practice feels like bycicle with an added support motor
(weak and unbalanced) compared to a current motorbike (Python)
>While other types of inheritance can work, more often than not, they cause more problems. Think about inheriting multiple Error methods. Which one fires?
Last century in C++ I did not try to force MI, but checking out Python I overindulged in it,
partly to get a "feel" for the problems occurring when using not the best tool for a task.
I did not run into the troubles usually cited - and for the Error problem the declaration order
specifies the lookup order for the method. If you need something different from that,
overriding the problematic method is easy [and better OOP in my book: only program the difference]
and if you need, you can call none, a specific parent class method or a combination of them via
the classname of the parentclass. Not a problem, but an opportunity <g>.
my 0.02 EUR
thomas
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement