W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2012

Re: Dictionary or interface?

From: Anne van Kesteren <annevk@annevk.nl>
Date: Mon, 9 Jul 2012 22:58:25 +0100
Message-ID: <CADnb78i2VcXZLkdy=EvfP2TFVdtLjdWZ-G-8TW8GyJP5QQ90aA@mail.gmail.com>
To: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Cc: public-script-coord@w3.org
On Mon, Jul 9, 2012 at 10:42 PM, Jussi Kalliokoski
<jussi.kalliokoski@gmail.com> wrote:
> In the spec, we have a MIDIMessage interface [1], that can be either
> machine-generated (coming in from a device) or created by the user using
> MIDIAccess::createMIDIMessage [2]. What I'd like to do is get rid of the
> whole createMIDIMessage and make the MIDIMessage a dictionary so that
> developers could just pass an object that looks like a MIDIMessage to
> methods that take one as an input. However, the MIDIEvent interface [3]
> contains a collection of MIDIMessages, so I'm not sure how that would work
> if MIDIMessage is a dictionary.
> Any ideas? Thanks for the help.

Define a MIDI object with a constructor. Let the constructor take a
dictionary as argument to set its various attributes. Then you can
create an object using new MIDI(...) and it can be returned from

Received on Monday, 9 July 2012 21:58:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:07 UTC