Why is MouseAdapter an adapter?

前端 未结 4 463
星月不相逢
星月不相逢 2020-12-10 13:00

The name (and javadocs) imply that MouseAdapter is an adapter (the design pattern). But I don\'t see it as such - it doesn\'t adapt anything to anything, at fir

4条回答
  •  轮回少年
    2020-12-10 13:25

    Yes, it is not an adapter in the sense of GoF pattern because it does not adapt anything. It can be considered an instance of Abstract Class pattern [woolf97]:

    The superclass may provide a complete implementation that is a default or minimal implementation.

提交回复
热议问题