Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 45

Thread: Use Hibernate Entities in the web layer?

  1. #21
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    You might try and contact Ben Alex and request for usage of the ROO framework (maybe under some agreement?).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  2. #22
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by ozgwei View Post
    ...However, when using Hibernate, domain objects can be persisted transparently without the domain object being persisted beware of the fact that it's being persisted. Thus, a corrupted domain object can easily be persisted to database....
    Just small technical remark - with Hibernate you can alway use interceptors to call validate() before save and to avoid saving of corrupted objects (see chapter 12.1 in the Hibernate reference manual).

    Regards,
    Oleksandr

  3. #23
    Join Date
    Jun 2007
    Posts
    19

    Default

    Quote Originally Posted by al0 View Post
    Just small technical remark - with Hibernate you can alway use interceptors to call validate() before save and to avoid saving of corrupted objects (see chapter 12.1 in the Hibernate reference manual).

    Regards,
    Oleksandr
    Thanks, Oleksandr. That's a neat solution if the domain object is ever allowed to be in an invalid state.

    If you have many domain classes that must be validated before saving, you'll probably have to extract a Validatable interface...

    And keep in mind that interceptors can only throw RuntimeException while validation errors may be business exceptions, which are usually modelled as checked exceptions.

  4. #24
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by ozgwei View Post
    Thanks, Oleksandr. That's a neat solution if the domain object is ever allowed to be in an invalid state.

    If you have many domain classes that must be validated before saving, you'll probably have to extract a Validatable interface...

    And keep in mind that interceptors can only throw RuntimeException while validation errors may be business exceptions, which are usually modelled as checked exceptions.
    There is much worse problem there - you can not predict at which moment in time object will be saved and so where in your code you have to deal with this exception. Very likely, very far away from point where you are able to treattreat business exception meaningfully.

    But, anyhow, kind of errors that we discuss now (attempt to save non-complete object) is rather programmatic error and not business error and so it is nothing wrong in the unchecked exception.
    Note, that validate() itself may throw checked exception (as it is likely to be used outside of interceptor as well) and
    interceptor converts it to the unchecked one (consider the interceptor as "last ditch" )

    Regards,
    Oleksandr
    Last edited by al0; Jun 27th, 2007 at 08:42 AM.

  5. #25
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by mdeinum View Post
    You might try and contact Ben Alex and request for usage of the ROO framework (maybe under some agreement?).
    I guess it's worth a try but I don't fancy my chances, it seemed there's an understandable reluctance to release anything anytime soon when it was discussed.
    Last edited by karldmoore; Aug 29th, 2007 at 11:09 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  6. #26
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Well at least it is worth a try. Maybe register for the ALPHA/BETA test group .
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #27
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by mdeinum View Post
    Well at least it is worth a try. Maybe register for the ALPHA/BETA test group .
    Hehe, not a bad idea .
    Last edited by karldmoore; Aug 29th, 2007 at 11:09 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  8. #28
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by debasishg View Post
    Is there any pointer / documentation available on ROO ? I would like to see more of this. As a first impression, I think, irrespective of whether DTOs are being generated or hand-written, we have more classes. And most importantly dumb data holders as DTOs. But I really should not be commenting without having a look at ROO.
    Looks like the slides are available (you do have to register though).
    http://www.springone.com/download/at...5/22_03_02.pdf
    Last edited by karldmoore; Aug 29th, 2007 at 11:09 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  9. #29
    Join Date
    Jul 2006
    Location
    Kolkata, India
    Posts
    217

    Default

    Thanks Karl for the link ..

  10. #30
    Join Date
    Jul 2006
    Location
    Kolkata, India
    Posts
    217

    Default

    Quote Originally Posted by karldmoore View Post
    Looks like the slides are available (you do have to register though).
    http://www.springone.com/download/at...5/22_03_02.pdf
    Had a quick glance at the presentation. At one place he mentions DTOs are great for remoting. Couldn't agree more . But I am still not convinced why DTOs are being used for same JVM client applications. Every bit of separation of concerns, that come up in designing a domain rich application with a layered architecture, can be addressed, using the combination of domain objects (DO) and aspects. Why introduce boilerplates with no behavior ?

    My $0.02.

    Cheers.
    - Debasish

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •