Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 48480 invoked from network); 9 Jul 2007 06:17:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2007 06:17:10 -0000 Received: (qmail 66688 invoked by uid 500); 9 Jul 2007 06:17:11 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 66672 invoked by uid 500); 9 Jul 2007 06:17:11 -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 66659 invoked by uid 99); 9 Jul 2007 06:17:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2007 23:17:11 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of fmeschbe@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2007 23:17:08 -0700 Received: by ug-out-1314.google.com with SMTP id a2so1166682ugf for ; Sun, 08 Jul 2007 23:16:47 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=VotpxcCdFqh1EjG8N2FYi48HdMDcd92zN0iPFbjHISxNZArsDngYSAkUUokMGmaDGWb3lrF4h0F1OJLJYWd57Qg8Lu4tzG+xVM08YUT4iL3XiL4NX4AzkYBg5TMJbOVDz92RpP1S4IgVR2nSQ+ntiHgL1EaZp4Tj1q63KZsuheQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=ncfvj/maqcPQCHkrTe0gYsCeUGn+N++3b4i4QnXAvYCWLS/GGXfbWqhEAVNSCN4+N5YYC40uskndvyz1qoK253MXch1jGxpWLmq9Ws1RIOywo/wkaBa58rexaCsiTLe+luiEV7wZQxu45N4tFjXuuyf6TRfzYwJzol5cMctSjmc= Received: by 10.67.28.9 with SMTP id f9mr4875752ugj.1183961807285; Sun, 08 Jul 2007 23:16:47 -0700 (PDT) Received: from ?10.0.0.50? ( [62.192.10.254]) by mx.google.com with ESMTP id c28sm30793884fka.2007.07.08.23.16.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Jul 2007 23:16:46 -0700 (PDT) Subject: Re: DM Rule #5: References considered harmful. From: Felix Meschberger To: users@jackrabbit.apache.org In-Reply-To: References: Content-Type: text/plain Date: Mon, 09 Jul 2007 08:16:46 +0200 Message-Id: <1183961806.19219.89.camel@bslm-046.corp.day.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi David, I have the issue of creating a caching system, where I have my cache entries, which have dependencies of certain data. Of course, I would not create REFERENCEs to the real data to not lock down the user managing the data. But how about creating a mirror hierarchy of data to which the cache entries REFERENCE. In this case, when the real data is modified I can lookup the mirror and find the referring cache entries. The nice thing of having a REFERENCE property in this case is, that I can get the referents from the data (actually the mirro of it) node without having to employ a heavy weight search. What do you think ? Regards Felix Am Samstag, den 07.07.2007, 13:20 +0200 schrieb David Nuescheler: > Explanation > --- > References imply referential integrity. I find it important to > understand that references do not just add additional cost for the > repository managing the referential integrity, but they also are > costly from a content flexibility perspective. > > Personally I make sure I only ever use references when I really cannot > deal with a dangling reference and otherwise use a path, a name or a > string UUID to refer to another node. > > Example > --- > Let's assume I allow "references" from a document (a) to another > document (b). If I model this relation using reference properties this > means that the two documents are linked on a repository level. I > cannot export/import document (a) individually, since the reference > property's target may not exist. Other operations like merge, update, > restore or clone are affected as well. > > So I would either model those references as "weak-references" (in JCR > v1.0 his essentially boils down to string properties that contain the > uuid of the target node) or simply use a path. Sometimes the path is > more meaningful to begin with. > > I think there are usecases where a system really can't work if a > reference is dangling, but I just can't come up with a good "real" yet > simple example from my direct experience.