Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Adam Hardy
Matt Morton on 30/11/05 15:00, wrote: I have always wrestled with the DTO question. I guess I haven't seen the need for it while using Spring and Hibernate. I have also created objects that are specific to the view object (like a set of menu links) that is being created dynamically and then pop

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Matt Morton
ce of that exception, I suppose it's better to > handle > > That exception in your service layer, so you will give to the web layer > > A 'proper' collection rather than let the web layer handle that... > > > > HTH > > marco > > > > >

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Matt Morton
Tom Basically the initialization occurs in the DAO and then passes back a list of the requested objects. I try to limit what dom objects I am sending back so i only have to initialize a couple of branches occasionally. I have thought about having a layer that is specific to the view where the ob

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Jadeler
e that... > > HTH > marco > > > > -Original Message- > From: Tom Ziemer [mailto:[EMAIL PROTECTED] > Sent: 30 November 2005 15:39 > To: Struts Users Mailing List > Subject: Re: slightly [OT] Hibernate and domain objects in web apps > > Hi, >

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
collection rather than let the web layer handle that... HTH marco -Original Message- From: Tom Ziemer [mailto:[EMAIL PROTECTED] Sent: 30 November 2005 15:39 To: Struts Users Mailing List Subject: Re: slightly [OT] Hibernate and domain objects in web apps Hi, @Matt: thanks for y

RE: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Marco Mistroni
: slightly [OT] Hibernate and domain objects in web apps Hi, @Matt: thanks for your elaborate answer. My setup is a lot like yours: Spring manages the business objects and the DAOs. My problem is this: Struts->Business layer->HibernateDAO->Database will return a hibernate proxy of my dom

RE: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Marco Mistroni
eb layer handle that... HTH marco -Original Message- From: Tom Ziemer [mailto:[EMAIL PROTECTED] Sent: 30 November 2005 15:39 To: Struts Users Mailing List Subject: Re: slightly [OT] Hibernate and domain objects in web apps Hi, @Matt: thanks for your elaborate answer. My setup is a

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
Hi Borislav, yes, this is actually one big part of my problem: sometimes I'll need collections A and B of an object and sometimes no collections at all or different collections. How does your business layer represent this? Do you have one method in which you specify the attributes that are n

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Borislav Sabev
Tom Ziemer wrote: Hi Borislav, unfortunately I cannot do this, because I have a rich client and a (struts-based) web frontend. Consequently, my business layer must load and initialize all dom objects that are requested, because I cannot have an open session on my rich client that is using we

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
Hi, @Matt: thanks for your elaborate answer. My setup is a lot like yours: Spring manages the business objects and the DAOs. My problem is this: Struts->Business layer->HibernateDAO->Database will return a hibernate proxy of my dom object. I have to load all objects lazily, because our db ha

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Borislav Sabev
Marco Mistroni wrote: In my case I chooseed to have a common interface for DTO & domain, and I am just using BeanUtils to copy Properties between the two (so I save the hardcoded method copy) I use in most cases a mapped form i.e. a form with a map and use as well BeanUtils to copy the value

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Oles
Borislav Sabev wrote: Tom Ziemer wrote: Hi, I have got a little problem with Hibernate - well actually it is only partially related to it: My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to my Struts actions? If I do this, I'd have

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
Hi Borislav, unfortunately I cannot do this, because I have a rich client and a (struts-based) web frontend. Consequently, my business layer must load and initialize all dom objects that are requested, because I cannot have an open session on my rich client that is using web services to commu

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Borislav Sabev
Tom Ziemer wrote: Hi, I have got a little problem with Hibernate - well actually it is only partially related to it: My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to my Struts actions? If I do this, I'd have to deal with LazyInitial

RE: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Marco Mistroni
LazyInitializationException in your hibernate layer? Any reasons of why you can't do that? Regards marco -Original Message- From: Tom Ziemer [mailto:[EMAIL PROTECTED] Sent: 30 November 2005 14:51 To: Struts Users Mailing List Subject: Re: slightly [OT] Hibernate and domain

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Matt Morton
Hi Tom In our app we are using pattern where Struts calls a method from what I call a service layer object. Then the service layer calls the dao interface. Then there is an implementation of the dao for Hibernate. So the call stack is something like: Struts Action -> ServiceManager.getSomeObjec

Re: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
Struts Users Mailing List Subject: slightly [OT] Hibernate and domain objects in web apps Hi, I have got a little problem with Hibernate - well actually it is only partially related to it: My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to

RE: slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Marco Mistroni
y [OT] Hibernate and domain objects in web apps Hi, I have got a little problem with Hibernate - well actually it is only partially related to it: My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to my Struts actions? If I do this, I'd ha

slightly [OT] Hibernate and domain objects in web apps

2005-11-30 Thread Tom Ziemer
Hi, I have got a little problem with Hibernate - well actually it is only partially related to it: My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to my Struts actions? If I do this, I'd have to deal with LazyInitializationExceptions fo