From users-return-1177-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Oct 26 15:08:35 2006 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 93711 invoked from network); 26 Oct 2006 15:08:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 15:08:35 -0000 Received: (qmail 24624 invoked by uid 500); 26 Oct 2006 15:08:44 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 24599 invoked by uid 500); 26 Oct 2006 15:08:42 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 24583 invoked by uid 99); 26 Oct 2006 15:08:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 08:08:42 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jukka.zitting@gmail.com designates 64.233.184.228 as permitted sender) Received: from [64.233.184.228] (HELO wr-out-0506.google.com) (64.233.184.228) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Oct 2006 08:08:08 -0700 Received: by wr-out-0506.google.com with SMTP id i23so94675wra for ; Thu, 26 Oct 2006 08:07:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=V8BG0X5LVGZwcjXeS/Mx32KizuDh/CYGaM3q1DDyjKyqyDqYmxnKvQnVqr7a317MIauC/FNWYi5xruH36zHgh0QjOdcDuyaHabTcZwo/d2xSr4/2zmZ+BfHDlywArgmFC+Nh6ZI/OhWVhYUtBqiWm0Lnj6zutqTCZnkCUJZknxo= Received: by 10.78.149.13 with SMTP id w13mr2629920hud; Thu, 26 Oct 2006 08:07:30 -0700 (PDT) Received: by 10.78.175.15 with HTTP; Thu, 26 Oct 2006 08:07:30 -0700 (PDT) Message-ID: <510143ac0610260807n2ca9865bi87ae2ba86d752ea3@mail.gmail.com> Date: Thu, 26 Oct 2006 18:07:30 +0300 From: "Jukka Zitting" To: users@jackrabbit.apache.org Subject: Re: Where does JCR fit in JEE? In-Reply-To: <453DFB18.6090304@lnksystem.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <453DFB18.6090304@lnksystem.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 10/24/06, Srepfler Srgjan wrote: > I have implemented the DAO pattern so I can switch between > persistence layers but to me it seems the two approaches are mutually > exclusive. Can someone give me advice what's the best way to combine > these two technologies and how to get the most of both worlds? I generally prefer to expose the JCR Node/Property model all the way up to the business and presentation logic. The way I see it, the DAO pattern solves two different problems: it allows you to swap persistence mechanisms and it hides the underlying data access API behind a more natural OO API. The latter issue mostly affects cases maps poorly to implementing common business or presentation logic (JDBC). I find the JCR API quite natural to work with (compare Node.getProperty(...) with the JDBC equivalent of executing a SELECT, possibly caching the results over multiple calls, etc.) so from my perspective the main reason for using the DAO pattern over JCR is when you either need to use a persistence mechanism that doesn't support JCR or to transparently support different JCR content models. If you do need to apply the DAO pattern with JCR, I suggest you take a look at the JCR Mapping tool in the Graffito project (http://incubator.apache.org/graffito/). It's an object-to-content mapping tool for JCR just like the various object-to-relational mapping tools for JDBC. > Second question, can I "butcher" jackrabbit in order to take out the core > that handles the persistence stuff because I want to do all presentation > stuff on my own (that is, is there a clean core module that I can > integrate with my app)? The Jackrabbit core (jackrabbit-core-1.1.jar) contains no presentation logic. It should fit your needs pretty well. BR, Jukka Zitting