directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francois <>
Subject Re: DN API polishing
Date Thu, 05 Aug 2010 12:56:46 GMT
On 05/08/2010 13:17, Emmanuel Lecharny wrote:
> Hi guys,


Reply in the text underneath

> I'm in the process of polishing the API now that Kiran has included many
> of the missing parts. It raised some questions :
> 1) there are 3 different methods that give back the list of RDNs :
> - getAll()
> - iterator()
> - getRdns()
> One of them is obviously a duplicate. The getAll() is a remaining taint
> of the ancient JNDI API : DN was implementing Name back 5 years ago. I
> don't think we need it anymore.

Agree with that.

> The iterator() and getRdns() are doing the exact same thing, which is
> different from the getAll() mtehod : there return the inner RDNs in the
> revert order.
> For instance, if we have a DN like 'dc=c, dc=b, dc=a', there each of
> those three methods will return RDNs in the following order :
> o getRdns() and iterator() :
> 'dc=c' then 'dc=b' then 'dc=a'
> o getAll() will do the opposite :
> 'dc=a' then 'dc=b' then 'dc=c'
> I think that the iterator() method should behave as the getAll() method
> does, and getRdns() should keep the internal order (as it simply return
> the inner field storing the rdns.

I'm not really sure we need the two... A reverse is really easy to do if 
getRdns return a list, and as you said, there is no need to make DN api 
heavier than needed...

About the return type, I would prefer to have a collection I could use 
directly (a List, or even better an immutable list or a list of copies 
of RDN) than an iterator.

> 2) The JNDI related methods like toName( DN ) and fromName( Name ) have
> been moved to the JndiUtils class. There is no reason to make the DN api
> more heavy than strictly than necessary, IMO

Clearly with you on that.

> 3) There are helper methods like normalize( DN, OIDMap ), normalize(
> String, OIDMap ) or normalize( OIDMap ) that does not belong to the DN
> public API : theyr are used by tests. I think they should also be
> removed from the DN api.

Agree on that point too.

Francois ARMAND

View raw message