Return-Path: Delivered-To: apmail-directory-api-archive@minotaur.apache.org Received: (qmail 97241 invoked from network); 28 Jul 2010 08:55:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jul 2010 08:55:01 -0000 Received: (qmail 48773 invoked by uid 500); 28 Jul 2010 08:55:01 -0000 Delivered-To: apmail-directory-api-archive@directory.apache.org Received: (qmail 48726 invoked by uid 500); 28 Jul 2010 08:55:00 -0000 Mailing-List: contact api-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: api@directory.apache.org Delivered-To: mailing list api@directory.apache.org Received: (qmail 48718 invoked by uid 99); 28 Jul 2010 08:54:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 08:54:59 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jul 2010 08:54:52 +0000 Received: by wwj40 with SMTP id 40so2143986wwj.1 for ; Wed, 28 Jul 2010 01:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=93JI0h9tCtFXozEfBze+sB9laAnjxAVP+NbKsHbDTAs=; b=VFBrl62sxL76qzhOD6NOrk0FPv0zJnFnLNVOAS5TieS3gZ718WCgcJ4A1S2TGv7gfH lSPBcABp98+dSXs7uaO3cAYXqrL/WgrhxHZMjL51Ckyi9ts9M03uRG/RB6c4vcuE+rI5 56Enjs7CBuakGeEjtFsD6IBSb6qVGJ9FJycA8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=Jyk+/z40WHLv4nGHKcLimIC6wvBl4TPe9cnZmUOgnqDWE2VjuQVXRjC3Zl2S8DOZJT xiLIH99H4SPd9pSkZGgjilFuzDWkssd0VoHnl1i14j4xSIcUC+uf3FpbC7wSxfSxfs4F ybB+RJxmqturzifdtGHUEq2FvbgCCpSEezIHA= Received: by 10.227.152.18 with SMTP id e18mr10300582wbw.1.1280307271505; Wed, 28 Jul 2010 01:54:31 -0700 (PDT) Received: from emmanuel-lecharnys-MacBook-Pro.local ([78.192.106.184]) by mx.google.com with ESMTPS id v16sm3286832weq.32.2010.07.28.01.54.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 01:54:30 -0700 (PDT) Message-ID: <4C4FF0D4.2040108@gmail.com> Date: Wed, 28 Jul 2010 10:56:52 +0200 From: Emmanuel Lecharny Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: api@directory.apache.org Subject: DN and valueOf( "" ) method Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi guys, I was thinking lately about the DN class. I know that OpenDS (and probably UnboundId, but not sure) has a DN.valueOf( "" ) 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( "" ) method. This factory will handle its cache, which will be global. thoughts ? -- Regards, Cordialement, Emmanuel L�charny www.iktek.com