Is OOP & completely avoiding implementation inheritance possible?

前端 未结 8 2297
故里飘歌
故里飘歌 2020-12-15 05:34

I will choose Java as an example, most people know it, though every other OO language was working as well.

Java, like many other languages, has interface inheritance

8条回答
  •  温柔的废话
    2020-12-15 05:43

    To make mixins/composition easier, take a look at my Annotations and Annotation Processor:

    http://code.google.com/p/javadude/wiki/Annotations

    In particular, the mixins example:

    http://code.google.com/p/javadude/wiki/AnnotationsMixinExample

    Note that it doesn't currently work if the interfaces/types being delegated to have parameterized methods (or parameterized types on the methods). I'm working on that...

提交回复
热议问题