Dropping (or deprecating) event initialization methods

As has been pointed out, there are problems with the current pattern of
init* methods on event interfaces.  The below come to mind:

  * it is difficult to remember the arguments to them (initMouseEvent
    has 15!)

  * adding attributes to an interface would mean either adding an
    argument to the method (breaking binary compatibility for languages
    where that matters) or introducing a new one to override the first

  * adding attributes to a parent interface, like UIEvent, would mean
    that the intuitive argument order could not be kept in the child
    interface’s method

I suggest that we dispense with this pattern, and instead make all of
the attributes that these initializer methods would set writable.  If
assigned to during event dispatch, an exception would be thrown.  I
suppose some web content would rely on these methods currently, but I
would guess it’s not much.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Friday, 18 September 2009 07:58:22 UTC