Hello Jukka,

You are saying that you use JCR objects directly as the model to access
in the view. But if you're using JSP for the view, you can't call
methods like getProperty(String) using the JSTL expression language. So
I guess you're using scriptlets to access them, but I would rather use
taglibs and JSTL. How do you do it?

Tom

-----Original Message-----
From: Jukka Zitting [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 14, 2007 23:34
To: [email protected]
Subject: Re: JCR Design Pattern Question- DAO class per NS?

Hi,

On 1/15/07, Wolf Benz <[EMAIL PROTECTED]> wrote:
> So is what you're saying this:
>
> 1 App ~ 1 NameSpace
> & in that NameSpace: 1 Node Type ~ 1 DAO Class (roughly) ?

Yes, roughly. :-)

> Roughy that will do I guess, unless some classes are intermingled
> enough to allow 1 DAO for 2 Node Types making more sense.

Yeah, depends on how your content structure.

In fact I usually avoid the traditional DAO pattern when working with
JCR. DAOs work well when you are accessing a relational database or
some other data store whose content model is relatively foreign from
an OO perspective. JCR gives you methods like getProperty() and
setProperty() that allow very "natural" access to underlying content
without having to use an intermediate abstraction layer.

In a MVC architecture I normally use the JCR content repository
directly as the Model without any abstraction layer on top of it. In
the View I use Node.getProperty() instead of DAO bean getters and in
the Controller I have access to the full JCR feature set. This way I
can directly leverage features like versioning or observation without
any extra mapping code.

BR,

Jukka Zitting


Reply via email to