directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
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<>  wrote:
>> On Thu, Apr 28, 2011 at 5:39 PM, Emmanuel Lecharny<>  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
>>> to be the method to use. Having to use LdapConnection.searchEntries()
>>> instead is a bit problematic.
>>> What about transforming the 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>
>>> 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 SearchRequest ) returns a cursor<SearchResponse> 
but that the 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.

Emmanuel L├ęcharny

View raw message