Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A052A18979 for ; Tue, 13 Oct 2015 07:55:07 +0000 (UTC) Received: (qmail 78049 invoked by uid 500); 13 Oct 2015 07:55:07 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 77995 invoked by uid 500); 13 Oct 2015 07:55:07 -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 77985 invoked by uid 99); 13 Oct 2015 07:55:07 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2015 07:55:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DB745C084E for ; Tue, 13 Oct 2015 07:55:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.121 X-Spam-Level: X-Spam-Status: No, score=-0.121 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id N4UkeajLbB3d for ; Tue, 13 Oct 2015 07:55:06 +0000 (UTC) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 0F0C92054C for ; Tue, 13 Oct 2015 07:55:06 +0000 (UTC) Received: by wieq12 with SMTP id q12so18580738wie.1 for ; Tue, 13 Oct 2015 00:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=QfLgIpqJsi1LJyJnFIWqMl9CSGKqpbogQm6qaTiV2rQ=; b=xldKP37kZ2AaMZfX6o8mYd+1ptVH6nDBchlw9Xem2Oc0WE967qWI93Ht34QDxvptE3 X/QoEYlJawlgKzbiPzzfD39Li/QkU9/Z8uGyt29bNNf9ss2FdmEs5HwIf6tfGLuygyTG m6gmaAVZ7xKP6orYvHSiS0eWo4IZcvb9sXhrIeU/YzWqGNopxibgHoLAjtuqY7UXAYDa 1W6Q/nKSnSqTVRvVe2QIprXINj75KyHF+mKDSzwiWXMDI/fpWJNaZefcLzc4jQysYAjW RzWuI6CjTxdFE5QPN9YJFSpxS5p6tcksvVMJ4uzP/dRWuuqvwphE4Q03HOGgCNB7gorb h3vw== X-Received: by 10.194.21.163 with SMTP id w3mr34741166wje.70.1444722905781; Tue, 13 Oct 2015 00:55:05 -0700 (PDT) Received: from [192.168.1.29] (AMontsouris-651-1-109-118.w83-202.abo.wanadoo.fr. [83.202.224.118]) by smtp.googlemail.com with ESMTPSA id hk5sm2028250wjb.6.2015.10.13.00.55.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 00:55:04 -0700 (PDT) Subject: Re: Value handling ideas To: Apache Directory Developers List References: <561C010F.4090401@gmail.com> From: =?UTF-8?Q?Emmanuel_L=c3=a9charny?= Message-ID: <561CB8D4.9020901@gmail.com> Date: Tue, 13 Oct 2015 09:55:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Le 13/10/15 07:29, Kiran Ayyagari a écrit : > On Tue, Oct 13, 2015 at 2:50 AM, Emmanuel Lécharny > wrote: > >> Thoughts about value handling in the API and Server >> --------------------------------------------------- >> >> >> Another idea would be to simply hide the byte[] unless we need to >> convert them to a String, which can be done when needed. We need to >> convert the values when we do a normalize (this happens when we want to >> compare the value to another one), or a compare. We also need to run >> every value through the PrepareString methods (and PrepSASL for the >> userPassword) before saving them to the disk. >> >> but AFAIU this conversion happens multiple times if not stored, so I still > prefer converting once and use the stored value later onwards Actually, once converted, we should keep a copy of the converted value, to avoid any further conversion.