Re: ACTION-19 contact api review / feedback

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