Relative Content

Tag Archive for multiple-inheritance

Replacing Multiple Inhertance with delegation

I was going through “Object Oriented Modelling and Design” by James Rumbaugh et al and it said that in languages where multiple inheritance is not supported like Java three mechanisms can be used as workarounds

Proper workaround for multiple inheritence in Java (Android)

I have a conceptual problem with a proper implementation of code which seems require multiple inheritance, that would not be a problem in many OO languages, but as the project is for Android, there is no such thing like multiple extends.

How does C++ handle multiple inheritance with a shared common ancestor?

I’m not a C++ guy, but I’m forced to think about this. Why is multiple inheritance possible in C++, but not in C#? (I know of the diamond problem, but that’s not what I’m asking here). How does C++ resolve the ambiguity of identical method signatures inherited from multiple base classes? And why is the same design not incorporated into C#?

Python multiple inheritance or decorators for composable behaviours

I recently discovered (or rather realised how to use) Python’s multiple inheritance, and am afraid I’m now using it in cases where it’s not a good fit. I want to have some starting data source (NewsCacheDB,TwitterStream) that gets transformed in various ways (Vectorize,SelectKBest,SelectPercentile).

Term for a Class with Multiple Interfaces

Say I have a class that implements multiple interfaces. I pass the same instance around using a different interface, depending on what the consumer is interested in.