jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Waschkowski" <mwaschkow...@gmail.com>
Subject Re: DM Rule #5: References considered harmful.
Date Mon, 09 Jul 2007 16:03:22 GMT
Hi David,

Really appreciate you bringing these comments to the mailing list, its
making me really think about how to do modeling within a repository, thanks!

What about when the repository is being used instead of a database?

ie.
User stores a bunch of contacts
User stores a bunch of buildings
User wants to link each building to a contact. Different buildings may want
to refer to same contact.

Isn't this a perfect use case for using a reference?

Cheers,

Mark

On 7/7/07, David Nuescheler <david.nuescheler@gmail.com> wrote:
>
> 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.
>



-- 
Best,

Mark Waschkowski

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message