Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E0EAE998F for ; Wed, 14 Mar 2012 15:54:54 +0000 (UTC) Received: (qmail 9951 invoked by uid 500); 14 Mar 2012 15:54:54 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 9919 invoked by uid 500); 14 Mar 2012 15:54:54 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 9906 invoked by uid 99); 14 Mar 2012 15:54:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2012 15:54:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of julian.reschke@gmx.de designates 213.165.64.22 as permitted sender) Received: from [213.165.64.22] (HELO mailout-de.gmx.net) (213.165.64.22) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 14 Mar 2012 15:54:46 +0000 Received: (qmail invoked by alias); 14 Mar 2012 15:54:25 -0000 Received: from unknown (EHLO [42.1.3.190]) [192.147.117.12] by mail.gmx.net (mp072) with SMTP; 14 Mar 2012 16:54:25 +0100 X-Authenticated: #1915285 X-Provags-ID: V01U2FsdGVkX1/APYJ1hFHAre8Ar6t905KtCQPjh6bbDHn+9E8hBw YfbUwhWgrYQGHm Message-ID: <4F60BF30.6040001@gmx.de> Date: Wed, 14 Mar 2012 16:54:24 +0100 From: Julian Reschke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: oak-dev@jackrabbit.apache.org CC: =?ISO-8859-1?Q?Michael_D=FCrig?= Subject: Re: Semantics of MicroKernel.getNodes() References: <4F60A2FB.8010203@gmx.de> <4F60BD76.3020800@apache.org> In-Reply-To: <4F60BD76.3020800@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org On 2012-03-14 16:47, Michael D�rig wrote: > > > On 14.3.12 14:54, Julian Reschke wrote: >> Hi there, >> >> I'm looking at MicroKernel.getNodes(), and I believe the semantics might >> perform non-optimal unless we get the property filtering right. >> >> A typical use case always is browsing a repository using a tree view. >> >> A tree view usually needs, given a node N: >> >> - all or a subset of all properties of node N >> >> - the set of child node names, and for each of these child nodes, a >> predefined set of properties that will allow the caller to decorate the >> node properly -- such as whether it's a container, and maybe the type). > > Couldn't we use the filter parameter for such cases. AFAIK the parameter > is currently in the API only and its semantics is not defined yet. So if > we come up with the right semantics for it, wouldn't that work? It probably will, and we should keep this use case in mind when we define it. >> Another problem is the String-fits-all return type; it would make it >> impossible to implement streaming of the result to the client; which >> will make the behavior for large collections non-optimal (the caller >> needs to wait for the complete JSON string to be ready before it can >> start forwarding information up the stack). > > Right. It was decided very early in the process to make the API string > based in order to be language agnostic (i.e. leave the option for a C > implementation). However we should really re-evaluate this requirement > and its consequences taking into account the current situation. String-based doesn't necessarily imply it needs to use Java String objects (and yes, Thomas, I saw your comment and will have a look at that). In general, if Java talks to Java of course it's a waste of time to serialize things into a String that need to be parsed again next. The JSON data model may be the right thing, and using application/json on the *wire* may make a lot of sense, but that doesn't necessarily mean it needs to be the only thing a Java API to the MicroKernel accepts... Best regards, Julian