[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Why ldap_<first,next>_attribute ?



Hello,

>I don't think there is any special reason why the
>ldap_first/next_attribute() approach was used instead of just returning
>an array.  The implementation of a function like ldap_get_attributes()
>is easy, as you say, but might be worth including in the API as a
>convenience.  What do others think?


I'd like to suggest that there is a ldap_get_attributes() in the API; whenever I used the LDAP V2 API (RFC 1823) I had to scan all attributes using ldap_first/next_attribute(). I never stopped before the end; so all I really need is ldap_get_attributes().

I´t's not hard to implement - true; but I guess most people will use ldap_get_attributes().

The only reason I could imagine why ldap_first/next_attribute() is better: if next_attribute() returns an error you can simply skip this attribute (and print some error message).
The array which would be returned by ldap_get_attributes() had to have a field "error" for each attribute returned to have the same property.

Bye,
        Jochen.
---
Dr. Jochen Keutel
Senior Consultant - X.500, LDAP, ...
Berlin, Germany