Is there a specific design pattern that describes the scenario where a non-abstract default implementation is provided that implements all or some of the method
There are no design patterns for default implementation.
I usually append DoNothing
prefix to the name of class. Depending on it's intent I use also Base
or Default
(the latter is widely used). Probably MouseAdapter
should be called DefaultMouseListener
.
In the case you care, you can stub systematically an interface with a simple DynamicProxy, you must return only a "nice" default value (null for Object, 0 for numeric, etc).
BTW this is a very good question.
EDIT
Furthermore this is neither a Stub or a Mock: maybe it can be confused with a Stub but the intent is different.