W3C home > Mailing lists > Public > public-device-apis@w3.org > October 2009

Re: ACTION-19 contact api review / feedback

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Wed, 14 Oct 2009 13:10:07 +0300
Cc: "brian@westcoastlogic.com" <brian@westcoastlogic.com>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-Id: <16A14086-819D-4C5A-8D3B-AB71684F1D37@nokia.com>
To: "ext richard.tibbett@orange-ftgroup.com" <richard.tibbett@orange-ftgroup.com>
On 13.10.2009, at 19.21, ext richard.tibbett@orange-ftgroup.com wrote:
>>
>> On 9.10.2009, at 17.12, ext richard.tibbett@orange-ftgroup.com wrote:
>>
>> The find method should perhaps be described as something like
>> (reflecting the latest Contacts API ED):
>>
>> sequence<Contact> find (in sequence<ContactFilter> filters);
>>
> Suggesting Object was to allow for one ContactFilter to be passed OR a
> sequence of ContactFilter objects to be passed, effectively allowing
> represention of 1 or n ContactFilters. Having said that, your proposal
> is simpler and consistent, though an Array object will always be
> required, even for just a single ContactFilter object. I should have
> explained the rational for Object in my original email. I can live  
> with
> either proposal.


I reflected this issue against jQuery API [1] which is considered  
intuitive by many developers and it seems many of its methods* use  
overloading similar to your proposal. Thus it seems justifiable to  
also support passing one ContactFilter object directly to the find  
method w/o forcing the object to be wrapped into an Array (albeit  
that's also supported). This leads us to the following interface  
definition for the overloaded find method:

sequence<Contact> find (in ContactFilter filter);
sequence<Contact> find (in sequence<ContactFilter> filters);

(The argument passing convention discussed herein is related to the  
ISSUE-1. We could take a look at the other established JavaScript  
libraries as well for more extensive analysis if that's seen  
beneficial by the group.)

-Anssi

[1] <http://api.jquery.com>

* At least val(), not(), add() $.param(), jQuery() and queue().
Received on Wednesday, 14 October 2009 10:10:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:39 UTC