Return-Path: Delivered-To: apmail-directory-api-archive@minotaur.apache.org Received: (qmail 31006 invoked from network); 14 Jan 2010 22:29:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2010 22:29:10 -0000 Received: (qmail 5059 invoked by uid 500); 14 Jan 2010 22:29:10 -0000 Delivered-To: apmail-directory-api-archive@directory.apache.org Received: (qmail 5034 invoked by uid 500); 14 Jan 2010 22:29:10 -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 5024 invoked by uid 99); 14 Jan 2010 22:29:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 22:29:10 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.219.217 as permitted sender) Received: from [209.85.219.217] (HELO mail-ew0-f217.google.com) (209.85.219.217) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 22:29:00 +0000 Received: by ewy9 with SMTP id 9so54275ewy.11 for ; Thu, 14 Jan 2010 14:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=QP9TFKa/HrA/xLT1Xd77x51QdLZ9CVjZfEa7+FJ4ktk=; b=eNLfaGrYCTED6VAgkdsm5Ylg3ehkt3XRg9iembVLUBQKsC57hJNDJQSH8uquAn03CN ue+1BOp5ixditHY7TK1oVqkvn6SKuerIPxTtj6EEcSGSLnbQx99P1c/0k8DUhh7nOLIr wnYkbL3iw6sQ57EvzWoCRPYsiwCmMkmqZH7Lo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=wb9ia6K6zBN8uj/26NshnMRySDL3JwgsHk13khQSqxgsn9moLgdzH5CZ9T7FDGJlDc Qjrp2wW5gFeMqpjymDMvSQA1IMoxisCt+Nku24Q0w4z7d3JdREOR1jMIXoVnJNA9T+2A pwiklTgN9/pS5m5EwVBVJRbRnDmWKrC7PmcYM= Received: by 10.213.96.221 with SMTP id i29mr1464356ebn.33.1263508120624; Thu, 14 Jan 2010 14:28:40 -0800 (PST) Received: from emmanuel-lecharnys-MacBook-Pro.local (vol75-3-82-66-216-176.fbx.proxad.net [82.66.216.176]) by mx.google.com with ESMTPS id 10sm1435625eyz.47.2010.01.14.14.28.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 14:28:39 -0800 (PST) Message-ID: <4B4F9A97.40800@gmail.com> Date: Thu, 14 Jan 2010 23:28:39 +0100 From: =?UTF-8?B?RW1tYW51ZWwgTMKOY2hhcm55?= User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: api@directory.apache.org Subject: Re: [DN] Existing API review References: <4B4C7948.3000503@gmail.com> <4B4DAD6E.4040204@sun.com> <4B4E5AA6.7060907@gmail.com> <4B4F90C0.8050809@sun.com> In-Reply-To: <4B4F90C0.8050809@sun.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Matthew Swift a écrit : > > > On 14/01/10 00:43, Emmanuel LŽcharny wrote: >> [...] >> Well, I don't really think that it's anything but implementation >> dependent, so from the API POV, it's irrelevant. As soon as we add >> the valueof() methods, those who want to add a cache can do it. >> > > It's very relevant from an API POV. Sorry, you don't caught what I wanted to express, or I wasn't able to express what I had in mind. I meant that discussing this point is irrelevant, just because having both the constructor *and* the valueof makes sense to me now. > Being future proof is an essential part of any API. Client > applications will need to be modified if a valueOf constructor is > added at a later date in order to take advantage of any potential perf > improvements. By including the valueOf initially applications can > choose to use the constructor knowing that they will inherit any > future improvements such as caching. On the same page. > > If for learnability reasons we decide that a DN(String) constructor is > required then so be it, but it should include Javadoc recommending > that users use the valueOf constructor in preference. Well, here, I disagree. Users are smat enough to understand the difference between both methods to create objects, and i don't thik we have to stress it out, otherwise people will keep asking 'why are you keeping those two guys in the API ?' > >>> >>> Also, I strongly believe that DNs and RDNs and AVAs should be >>> immutable objects (as well as any other low level API type). What do >>> you think? >> DN and RDN should be immutable, sure. AVA, I have some doubt. > > If AVA is mutable then it is impossible for DN and RDN to be immutable > unless they do defensive copies which will be a bit annoying. I'm probably confusing the creation of AVA and the presence of setters. Anyway, if AVAs is not visible, it' s a non issue. > > >>> >>> Also, on the subject of AVAs - we have the AVA type as an inner >>> class in RDN. I'm not particularly happy with this this, but less >>> happy with it being a standalone class since AVAs are only used in >>> RDNs and may introduce confusion elsewhere. For example, filters >>> also use attribute value assertions but these are not the same type >>> of object as an AVA even if they have the same name. For example, >>> AVAs (in RDNs) do not allow attribute options or matching rules to >>> be specified. >> I don't really like inner classes in this case for two reasons : >> - It will be a big class, and the RN class while be hundreds of line >> long. Not cool >> - If we just use an Inner class just because we want to hide it from >> the other classes, then I think it's probably better to have it >> package protected (ie, no qualifier for this class). >> > > If it's package protected then the class will not be part of the > public API. I'm not sure that I understand? Well, it's to protect the class from being used (then no need to make it immutable ;)