Hello,
Qooxdoo event mechanism follows DOM event mechanism, and while it would be
possible to create wrapper object for the event as you propose, it would
break the consistency.

And what you propose that qx.event.type.Data would itself have "fire"
method is impossible, since event objects are the bearer of the data of the
event. For optimization, they are pooled and reused, however while used
they are unique to the event fired.

Cheers
Mikee


On Wed, Mar 20, 2013 at 3:47 PM, Terrence Brannon <[email protected]>wrote:

> The formatted version of this question is at -
> https://gist.github.com/metaperl/5205183#file-gistfile1-md
>
> But I will paste it inline for those who prefer to read markdown.
>
>
> In [the Qooxdoo
> tutorial]
> (
> http://manual.qooxdoo.org/current/pages/desktop/tutorials/tutorial-part-2.html
> )
> we learn about declaring and then adding a listner to an event.
>
> The declaration is as follows:
>
> ```javascript
> events :
> {
>   "reload" : "qx.event.type.Event",
>   "post"   : "qx.event.type.Data"
> },
> ```
>
> And the firing of one of the events via a listener is:
>
> ```javascript
> postButton.addListener("execute", function() {
>   this.fireDataEvent("post", textarea.getValue());
> }, this);
> ```
>
> Now, my question centers around `this.fireDataEvent`. The issue here
> is that fireDataEvent is a [Verb Subject code
> smell](http://c2.com/cgi/wiki?VerbSubject) ... in other words, `this`
> should have a `qx.event.type.Data` instance called `this.postEvent`
> and
>
>     this.fireDataEvent("post", textarea.getValue())
>
> should have been:
>
>     this.postEvent.fire(textarea.getValue())
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to