Why is MouseAdapter an adapter?

前端 未结 4 472
星月不相逢
星月不相逢 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:35

    MouseAdapter first appeared in Java 1.1 released in Feb 1997. This means that it was developed sometime in 1996 (or 1995?)

    UML (in its draft) was completed by 1997.

    The first GoF book on design patterns was published in 1995.

    So, I don't think that Adapter in MouseAdapter had anything to do with the corresponding design pattern. Or, even if it did, developers just had no unified language to express design patterns which would make it very hard to comprehend the real meaning.

提交回复
热议问题