2009/11/16 Fabián Mandelbaum <[email protected]>: > It's simpler than fiddling around with this low-level stuff actually: > > Just create a DAO to abstract all JCR operations (as you should be > doing already)
(To give my usual opinion about object content mapping and JCR:) If you use DAOs this of course is a straight-forward solution (but only for the code that uses the DAO layer), but I think that using JCR directly is not "low-level" stuff: - JCR Node already is like a DAO, and a more flexible one (nt:unstructured) - nodetypes can give you validation - session (+ transactions) provide all you need for managing the object's lifetime and separation into sessions - access control, versioning, search etc. are quite high-level IMO, so you should use them directly I see the point for DAOs only when you really want to be sure that application coders can only use the properties you designed for them. Or when you have a relational model and are required to map it onto an object model, but that's not the case with JCR. An OCM only adds an additional layer of code and complexity. Just my 2 cents... Alex -- Alexander Klimetschek [email protected]
