A heated debate popped up in the programming forum about whether referencing or using GUI “listener” API’s in the direct UI or application code is poor abstraction. To me, it’s an implementation detail that should be hidden away from most of the UI coding itself.

One typically wants to “attach” code to an on-click event of a button object, for example. How that code snippet is propagated around for implementation (executing) by the underlying UI system should not be “exposed” to the surface under ordinary circumstances. It’s like a device driver to me, and could be changed in the future.

One should not normally see mention of listeners nor their parts in direct application (domain) code.

(I know GUI’s are “out of style”, but it was merely an example to illustrate various points. Maybe they’ll come back in style; the industry often pendulums back and forth.)

Thanks

submitted by /u/Zardotab
[link] [comments]