Why We Have * Adapter Classes in Spring Java Configuration When They Are Not Adapters in the General Sense

When using Java configuration for Spring, you should see classes like WebMvcConfigurerAdapter and HandlerInterceptorAdapter that both implement the same interface and they follow the Adpater convention that should have been reserved for the real adapter (This particular class does not translate calls from one interface to another interface ).

Does anyone know if there is something wrong in my understanding / are they using a wrong convention?


source to share

1 answer

An adapter is also commonly used, at least in Java, to refer to base classes that provide invalid implementations of all methods of an interface. This is how the adapter should be understood in this context.

See for example MouseAdapter , MouseInputAdapter , MouseMotionAdapter , etc.



All Articles