Without knowing the exact details, I can offer one of the reasons that their approach has a kind of duck print. Regardless of the compilation time class of an object, if it has a method with the correct signature, it can be called.
Now, in general, I think that duck typing is not a big idiom in Java for this. However, there may be other justifications for this approach. In particular, this means that this code will not depend on compilation time in the device class. This can be, for example, one of the paths from circular dependencies, and an additional one makes the compilation step weaker.
In a broader sense, although if your approach works, I see nothing wrong with that. Using reflection is usually a workaround essentially for something that you cannot do in a more idiomatic way.
source share