Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 96556 invoked from network); 16 May 2006 16:52:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 May 2006 16:52:00 -0000 Received: (qmail 11748 invoked by uid 500); 16 May 2006 16:51:59 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 11710 invoked by uid 500); 16 May 2006 16:51:59 -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 11699 invoked by uid 99); 16 May 2006 16:51:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 09:51:59 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of enriquer9@gmail.com designates 64.233.184.239 as permitted sender) Received: from [64.233.184.239] (HELO wr-out-0506.google.com) (64.233.184.239) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 09:51:58 -0700 Received: by wr-out-0506.google.com with SMTP id i32so40241wra for ; Tue, 16 May 2006 09:51:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:reply-to:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=dU2ZfXM2Z3APCUdxKYNvsOGhxYT/R5IAuCbJ0UgArBkqC87VSK36FRcY0pkGuvk3D86tgEDA3W+KGISsgeAnC9f77q4r+C+tP2sVPivswM4iED0qqMCjsDpBPHWrq7lXzIC9E52Y+2yV9sXbX4jCH9h04MgYsq1Ugki0tdbasko= Received: by 10.54.62.14 with SMTP id k14mr1283652wra; Tue, 16 May 2006 09:51:34 -0700 (PDT) Received: from ?192.168.0.102? ( [24.147.18.235]) by mx.gmail.com with ESMTP id g9sm1541283wra.2006.05.16.09.51.33; Tue, 16 May 2006 09:51:34 -0700 (PDT) Message-ID: <446A040B.7080102@apache.org> Date: Tue, 16 May 2006 12:55:39 -0400 Reply-To: erodriguez@apache.org Organization: Apache Software Foundation User-Agent: Thunderbird 1.5 (X11/20060313) MIME-Version: 1.0 To: dev@directory.apache.org Subject: Re: svn commit: r406888 - /directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java References: <20060516095844.7316.qmail@minotaur.apache.org> In-Reply-To: <20060516095844.7316.qmail@minotaur.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: Enrique Rodriguez X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ersiner@apache.org wrote: ... > + > + /** > + * TODO: It's better to move this method to a common place. > + */ > + private static boolean parseBoolean( String bool ) > + { > + if ( bool.equals( "true" ) ) > + { > + return true; > + } > + > + return false; > + } > + > } This entire method is the same as saying: return bool.equals( "true" ); In which case, you could inline it: modifier.setLockedOut( val.toLowerCase().equals( "true" ) ); Or, Emmanuel's suggestion: modifier.setLockedOut( "true".equalsIgnoreCase( val ) ); Now, you have a negligible amount of code that almost added a dependency on shared-ldap. Besides bloating the kerberos code by 3 X there is also no conceptual link between kerberos and shared-ldap code. The problem here is not necessary code size, which in this day and age isn't that important, but rather the conceptual integrity of the artifacts we provide and a drastic increase in POM maintenance in product configurations as these sorts of deps trickle down. I'm sorry to use Ersin's commit as an example, but this sort of "eliminate duplication at all costs" mindset occurs quite a bit on this project and it makes POM maintenance in downstream product assemblies a lot harder. Moreover, the thing to recognize here is that we have configuration code in apacheds-core and protocol-common and helper methods like the above in many of the protocols and shared-ldap. In which case, the thing to do is form a configuration package. What I mean by "conceptual integrity" is that we could then point to a configuration artifact as the place for configuration library and utility code, as opposed to pointing to shared-ldap or apacheds-core or protocol-common, which have nothing to do, conceptually, with boolean text parsing or configuration. Enrique