The many great web UI toolkits that we use and have come to love seem to miss out one very important implementation detail that their desktop counterparts do so well, and that is the ability to bind an action (what a user can do; for example, edit profile) to multiple UI widgets so that the action is propagated across all bound widgets,while separating the action logic from the view logic.
Consider a scenario where you want to have an interface containing a top level menu, a ToolBar
, and a context menu, all having a "help" tool (Button
in ToolBar
and MenuItem
in Menu)
; you'll have to create three different widgets bound to three separate listeners just to implement this single tool.
What happens when the number goes up to 10? It means 10 widgets but 30 listeners, right? Even if the listeners are just a facade to the actual code that handles the click events, it will still be difficult to write and a nightmare to maintain.
Well, maybe we can further...