directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject DN and valueOf( "<a DN>" ) method
Date Wed, 28 Jul 2010 08:56:52 GMT
  Hi guys,

I was thinking lately about the DN class. I know that OpenDS (and 
probably UnboundId, but not sure) has a DN.valueOf( "<a DN>" ) factory 
that returns a DN potentially leveraging a cache associated to a 
ThreadLocal.

At first, I thought this was an excellent idea, and started to implement 
such a method in the DN class, but I didn't had time to finalize the 
code, so I let it beside for a while.

Now that I have had a bit of discussion about caching strategy inside a 
server, I'm coming  back to this specific valueOf() method.

I don't think it's such a good idea :
- first, as it's ThreadLocal based, you will have as many cache as you 
have threads processing requests. Not sure it competes with a unique 
cache, not sure either we can't use the memory in a better way...
- second, this is a server side cache : we don'yt need it on the client 
side (or, more specifically, if we need it, then I don't think it 
deserves to be managed by the DN class)

I would rather define a dedicated class, with a static method - a 
factory -, something like :
DnFactory, with a createDn( "<a DN>" ) method. This factory will handle 
its cache, which will be global.

thoughts ?

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


Mime
View raw message