Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 52919 invoked from network); 15 Feb 2011 23:00:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 23:00:43 -0000 Received: (qmail 30494 invoked by uid 500); 15 Feb 2011 23:00:43 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 30360 invoked by uid 500); 15 Feb 2011 23:00:42 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 30353 invoked by uid 99); 15 Feb 2011 23:00:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 23:00:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.214.50 as permitted sender) Received: from [209.85.214.50] (HELO mail-bw0-f50.google.com) (209.85.214.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 23:00:34 +0000 Received: by bwg12 with SMTP id 12so1145681bwg.37 for ; Tue, 15 Feb 2011 15:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:reply-to:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9SoIEd23XxyVuuIz1bO8hQ8PgS2usG2gsRPk0Ny45Qw=; b=f1xUcNZJs9HvulUWhsKv+ayv7nSvkiW52mwuGHFQgI0L+Tvppla+xX0Jus1EH8kvj/ TBgqFZT9KRpi2ivEGX6veJSmSbdBoZMePy2PTI33Vsn0PcfVMqhOBg8nTXmDuu2XVXNx amoB9nkZh0EHUT8soYep9oG1LmNP+mlxFDH2k= 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 :references:in-reply-to:content-type:content-transfer-encoding; b=Czpaiq0CsydTB4/GKU0W7xqh3fRErFu+JJGdI4qP2ARaeHT1n92VqqDIczh23VHlyr 5etxlhEKmtqpjUYpejKNJLIs74fc1HeGUtL/vgd7RA8eBFYvlpeixmOnqyWfHnpArUl3 E4LQ2bbrR/c8zBwty0muMY4wB9WLbjEz+/BAw= Received: by 10.204.49.68 with SMTP id u4mr806662bkf.43.1297810813983; Tue, 15 Feb 2011 15:00:13 -0800 (PST) Received: from emmanuel-lecharnys-MacBook-Pro.local (ran75-1-78-192-106-184.fbxo.proxad.net [78.192.106.184]) by mx.google.com with ESMTPS id u23sm3000691bkw.21.2011.02.15.15.00.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Feb 2011 15:00:12 -0800 (PST) Message-ID: <4D5B057B.8050404@gmail.com> Date: Wed, 16 Feb 2011 00:00:11 +0100 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.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Some inconsistencies in the DN class References: <4D57BF40.3060206@gmail.com> <4D594293.7010402@apache.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 2/15/11 11:12 PM, Stefan Seelmann wrote: > (back to list, I think Emmanuel sent it by accident to me) > > On Mon, Feb 14, 2011 at 3:56 PM, Emmanuel Lécharny wrote: >> Ok, after some cleanup, I come with two sets of restricted constructors : >> >> Empty Dn constructors : >> - Dn() >> - Dn( SchemaManager) >> >> Constructors having a DN (as a string) : >> - Dn(String) >> - Dn(SchemaManager, String) >> >> Constructors having RDNs (as strings) : >> Dn(String...) >> Dn(SchemaManager, String...) > I don't understand what's the difference between those two groups if one codes > new Dn("abc") > How does the runtime distinguish the two constructors. I have to read > the spec again... The Dn(String) uses a DN as a string, and the Dn(String...) is a bit more convoluted, as it almost anything which is a String, concatenate them to form a valid DN. >> Cnstructors having a set of RDNs : >> - Dn(Rdn) >> - Dn(SchemaManager, Rdn) > I guess you mean "Rdn..." Yep. >> The other constructors are most certainly spurious at this point : >> >> Dn(Rdn child, Dn parent) >> >> can be replaced by : >> >> parent.add( child ); >> >> as the Dn is an immutable class. >> >> Is it ok for all of you ? > I find it a bit inconvenient. If I see that a class has an "add()" > method I expect that when using that method that the object is > modified. I think I'd prefer to get rid of all the "add", "addAll" and > "remove" methods that pretend mutability. You are probably right. The problem is that if we want to remove the add() method, then we need to define a constructor like : Dn dn = new Dn( "dc=example,dc=com" ); Dn newDn = new Dn( dn, "sn=test" ); Do we want that instead of : Dn dn = new Dn( "dc=example,dc=com" ); Dn newDn = dn.add( "sn=test" ); ? -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com