Eric D Nielsen on 25/03/08 14:29, wrote:
Its a Struts2/Spring2/JPA(Hibernate) based project. I'm using a slightly
modified version of the Generic DAO pattern shown in the Java persistence with
Hibernate book and/or the IBM ThoughtWorks very similar example. (Modified to
allow Spring Based Injection of the JPA EntityManger, while falling back to a
native Hibernate session inside the DAOs to allow a few more optimizations).
So its basically
Business Objects (POJOs) <---1:1---> DAOs
which is a relatively normal pattern I beleive.
Is it normal with that Generic DAO pattern to name the DAOs 'services'? In the
Domain-Driven-Design paradigm that I generally follow, the services are objects
which carry out operations that you don't want to specifically assign to one
domain object.
[As a side issue: this is a place where the Get (returning a
proxy/lazy load thunk with only the ID set without hitting the DB) versus Load
could be useful, but I've never seen any of the generic DAO approaches expose
that level of control in their API -- does anyone know why?]
that's a pure Hibernate thing, I think, not a JPA distinction.
just use POJOs there. I believe this approach would work with the Model-Driven
idea, but it feels a little odd to me to mark up the domain object with
HTTP-specific details....
Yes it would do, but what do you mean by 'mark up the domain object with
HTTP-specific details'? I don't think you have to touch the domain objects to
code the re-construction of your incoming Bug POJO.
Regards
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]