3 ms·
Technically speaking, Java can have mixins as well if you include libraries that provide it. Stuff like Spring AOP uses aspectj under the covers and you can mi
by catch23 17y ago
Technically speaking, Java can have mixins as well if you include libraries that provide it. Stuff like Spring AOP uses aspectj under the covers and you can mimic mixin-like functionality in your classes with a few annotations here and there.
- strlen 17y agoTechnically, you could also provide mixins through the decorator pattern and interfaces. IntelliJ (and I am sure Eclipse) can generate this for me. However, that's less elegant and more fragile than using a language (e.g. Scala) which has Mixins as a language feature: IntelliJ can write code for me, but it can't read for me, nor can it explain it to other developers. Likewise, I can use multiple inheritance in C++ exclusively only to mimic interfaces (as purely virtual classes) or Mixins (and in fact a lot of corporate style guidelines, e.g. Google's explicitly say that), but it isn't quite the same as having these as language features.