directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Search result in LDAP API
Date Thu, 28 Apr 2011 16:14:02 GMT
On 4/28/11 6:06 PM, Kiran Ayyagari wrote:
> On Thu, Apr 28, 2011 at 9:30 PM, Stefan Seelmann<seelmann@apache.org>  wrote:
>> On Thu, Apr 28, 2011 at 5:39 PM, Emmanuel Lecharny<elecharny@gmail.com>  wrote:
>>> I like Stefan's idea a lot, but there is something a bit confusing : if a
>>> user tries to do a simple search, he will expect the LdapConnection.search()
>>> to be the method to use. Having to use LdapConnection.searchEntries()
>>> instead is a bit problematic.
>>>
>>> What about transforming the LdapConnection.search( SearchRequest ) method to
>>> LdapConnection.send( SearchRequest ) (and the very same for any complex
>>> request, using a Request instance) :
>>> - LdapConnection.send( AddRequest ) but LdapConnection.add( Entry )
>>> - LdapConnection.send( BindRequest ) but LdapConnection.bind( dn, password )
>>> - LdapConnection.send( SearchRequest ) but Cursor<Entry>
>>> LdapConnection.search( base, filter, scope, attrs...)
>>> - ...
>>>
>>> thoughts ?
>> Sure, that makes totally sense because the operation is already part
>> of the request class. And fortunately "search" will be listed before
>> "send" in the API docs and code completion popup window ;-)
>>
> I agree with all the other changes except for using send() as the name
> for all operation methods, I say this as an end user
> rather than a programmer of this API


This is not an easy choice.

The problme is that the user might be puzzled to see that a 
LdapConnection.search( SearchRequest ) returns a cursor<SearchResponse> 
but that the LdapConnection.search( base, filter, scope, attrs... ) 
returns a cursor<Entry>.

Using send( Request ) instead first makes the API lighter (we don't have 
to create one send() method per type of request, it can be hidden in the 
LdapConnection class) and it's also for advanced users.

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com


Mime
View raw message