directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject [DN] Existing API review
Date Tue, 12 Jan 2010 13:29:44 GMT

yesturday, I conducted a review on the existing APIs for the DN class :
- Name/LdapName (JNDI) (I will call it JNDI)
- jLdap/LdapSdk (I will call it LSD)
- ApacheDS (ADS)
- OpenDS (ODS)
- UnbounID (UID)

There are some important differences. There are two sets of API,
depending on the existence of a constructor, or not.

- API having a constructor :

- API not having a constructor :
ODS (ODS uses a static method valueof() to produce a DN)

IMHO, I really think that users prefer having a constructor over none or
a static factory. There are three rasons for that :
1) Most of LDAP users are using the JNDI API, which has a LdapNAME()
2) In Java, it's pretty natural to create objects through constructor.
3) I'm not sure that handling a cache for DN is a valuable trick, as it
leads to some contention and the need to manage this cache in a
muli-threaded environement (this has to be carefully evaluated)

I think that we should have some basic constructors, and if the cache is
proven to be valuable, then we can extend the API by adding the valueof(
... ) method.

The base constructor we can have are probably something like:
DN(String dnStr)
DN( RDN... rdns)
DN( RDN rdn, DN parent)

Thoughts ?

Emmanuel L├ęcharny

View raw message