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 2D5DB951E for ; Thu, 15 Mar 2012 09:25:53 +0000 (UTC) Received: (qmail 95406 invoked by uid 500); 15 Mar 2012 09:25:53 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 95364 invoked by uid 500); 15 Mar 2012 09:25:52 -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 95351 invoked by uid 99); 15 Mar 2012 09:25:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 09:25:52 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@adobe.com designates 64.18.1.39 as permitted sender) Received: from [64.18.1.39] (HELO exprod6og117.obsmtp.com) (64.18.1.39) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Mar 2012 09:25:43 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob117.postini.com ([64.18.5.12]) with SMTP ID DSNKT2G1gbzQYL3pLencjA+zfDHoEj7upmm4@postini.com; Thu, 15 Mar 2012 02:25:23 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q2F9NJJ0012419 for ; Thu, 15 Mar 2012 02:23:19 -0700 (PDT) Received: from nahub01.corp.adobe.com (nahub01.corp.adobe.com [10.8.189.97]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q2F9MbQ1027708 for ; Thu, 15 Mar 2012 02:25:19 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nahub01.corp.adobe.com (10.8.189.97) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 15 Mar 2012 02:24:20 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Thu, 15 Mar 2012 09:24:18 +0000 From: Felix Meschberger To: "oak-dev@jackrabbit.apache.org" Date: Thu, 15 Mar 2012 09:24:17 +0000 Subject: To String or not To String (was: Semantics of MicroKernel.getNodes()) Thread-Topic: To String or not To String (was: Semantics of MicroKernel.getNodes()) Thread-Index: Ac0CjWUoTZzpwQdzSNmsQMlpZd3oiw== Message-ID: <624F8A9B-4540-48BE-BD0E-692068C459B8@adobe.com> References: <4F60A2FB.8010203@gmx.de> In-Reply-To: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi, Am 15.03.2012 um 09:49 schrieb Stefan Guggisberg: > On Wed, Mar 14, 2012 at 2:54 PM, Julian Reschke w= rote: >> Another problem is the String-fits-all return type; it would make it >> impossible to implement streaming of the result to the client; which wil= l >> 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 forwar= ding >> information up the stack). >=20 > good point. how about returning a character stream (Reader/Readable) > instead of a string? I would like to start discussing whether it really makes sense to have Stri= ng as the argument types of the methods and saying the String values are ac= tually seriaized JSON data. Almost all interaction will involve serialization and deserialization, whic= h costs resources (time, CPU, memory). It has been said, that this is done to allow for non-Java implementations. = I think this argument is not really valid. All programming languages in use= today allow for structured data (even plain old C). So there is no need fo= r a String API. It has been said, that for writing to the storage or for remoting a String = is more helpful. I hold that the use of the data is an implementation detai= l. And if this detail would be important enough to make it into the API, it= would really have to be byte[]. It has been said, there are wrappers on top of the API to provide data stru= cture oriented API. It also has been said, that if we have such wrappers, s= omething sounds wrong. I tend to agree with this. So, I think that we should really replace the String-type arguments and res= ults said to be serialized data structures to real data structures we can d= ocument and fill with semantics. Regards Felix=