Page 1 of 1

Event delegation through a mediator tool

Posted: Mon Aug 02, 2010 1:21 am
by ooper
Would anyone be interested in a plugin that lets you select screen objects for the purpose of linking events to messages from source to multiple destination objects in an abstract fashion?

Example: imagine a Pizza Order card where you get to choose your toppings from a set of checkboxes, a field with a running total, and a checkbox for vegetarians.

The "Mediation" process: from the plugin palette and the Pointer Tool selected, you can click on each «topping» checkbox to assign mouse events for other objects to receive it, letting them respond accordingly. More specifically, one sender can be the Peperoni checkbox and the receiver objects can be 1) the field that manages the running total, 2) a List text field that keeps track of every item selected, and 3) the «Place Order» button that becomes enabled when (at minimum) one checkbox is selected. Similarly, the Peperoni checkbox is a destination of the event sent by the «Vegeterian» checkbox which will uncheck and disable the Meat group. The beauty of this is that the latter event will update the running total and the Place Order button will disable automatically! --unless, of course, a vegetarian item like mushrooms is selected :) This leads to very scalable user interfaces.

Among other things, the benefits include:
  • No hard coding of objects
    Much less code
    Encapsulation of state and state-management
    Transition of workflow is much more easily maintained
    Automatic user interface semantic behavior
    Undo and Redo
    Garbage collection is easily maintained
loose coupling, high cohesion, and much less code --which equals less bugs and faster release cycles!

The plugin: Through a palette, the Mediator plugin lets you click each screen object when the pointer tool is selected and builds a link between source and destination, as well as the dispatching mechanism that lets you then define the semantics of the event, including Undo and Redo. Among other things, the palette lets you prune the objects that get deleted in the development process.

Would you find this useful? Would you pay for such a tool? And if so, how much?

Thanks!
/Carl

Re: Event delegation through a mediator tool

Posted: Mon Aug 02, 2010 1:04 pm
by FourthWorld
Would this "Mediator" be equivalent to the "Controller" in an MVC model? If not, what distinguishes it?

Re: Event delegation through a mediator tool

Posted: Mon Aug 02, 2010 4:56 pm
by ooper
Hi Richard,

To answer your question, it is similar but not equivalent. The plugin ecompasses several design patterns, including Observer, Mediator, Memento and the MVC.

/carl