Re: using hibernate pojo as model instead of dto

2009-08-21 Thread Mathias Nilsson

I don't know about the good design but why should you make a detached copy of
an perfectly good entity? It's just more work.

However, if you need to use dto for webservices or there are some cases when
you need to get fields from different entities then maybe you should
consider dto. 
-- 
View this message in context: 
http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25079082.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: using hibernate pojo as model instead of dto

2009-08-21 Thread Fernando Wermus
The case I use DTO is when I have wizards that involves many entities or/and
some data that will become an entity but it is not the entity itself.
Besides, some types that I cannot use in wicket, or maybe yes, like JodaTime
DateTime.


On Fri, Aug 21, 2009 at 5:42 AM, Mathias Nilsson 
wicket.program...@gmail.com wrote:


 I don't know about the good design but why should you make a detached copy
 of
 an perfectly good entity? It's just more work.

 However, if you need to use dto for webservices or there are some cases
 when
 you need to get fields from different entities then maybe you should
 consider dto.
 --
 View this message in context:
 http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25079082.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


using hibernate pojo as model instead of dto

2009-08-20 Thread tubin gen
I am wondering If it is write to use hibernate pojo entities as model
objects for wicket components , or should I create a DTO and use them as
model objects , Is there any disadvantages of using entities POJO's as model
?


Re: using hibernate pojo as model instead of dto

2009-08-20 Thread Mathias Nilsson

You can use entities as models. Just use LoadableDetachableModels to avoid
LazyLoadingExceptions
-- 
View this message in context: 
http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25072411.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: using hibernate pojo as model instead of dto

2009-08-20 Thread fachhoch

Is this is a good design or using DTO is a good desing ?



Mathias Nilsson wrote:
 
 You can use entities as models. Just use LoadableDetachableModels to avoid
 LazyLoadingExceptions
 

-- 
View this message in context: 
http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25072993.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: using hibernate pojo as model instead of dto

2009-08-20 Thread Michael Mosmann
Am Donnerstag, den 20.08.2009, 18:59 -0700 schrieb fachhoch:
 Is this is a good design or using DTO is a good desing ?

it depends.. (IMHO there are only some situations where you can see some
benefit in DTO) ..

but you have to use LoadableDetachableModels or custom Model
implementations to avoid LazyLoadingExceptions

for short:
---
request comes in
  { open session for hibernate in OSV }
  render compontent
ask model for data
  model get it from hibernate with primary key
  render finished
throw temporary data away
  call detach() on model
model clears any reference to the hibernate object
  { close session for hibernate in OSV }
response goes out
---

mm:)

 
 
 Mathias Nilsson wrote:
  
  You can use entities as models. Just use LoadableDetachableModels to avoid
  LazyLoadingExceptions
  
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org