View Poll Results: Which would you choose?

Voters
33. You may not vote on this poll
  • OpenSessionInView

    17 51.52%
  • DTO/VO

    8 24.24%
  • Other

    9 27.27%
Multiple Choice Poll.
Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: OpenSessionInView vs DTO/VO vs ?

  1. #21
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    Quote Originally Posted by yatesco View Post
    IME it is impossible to stop idiots being idiots. I have come to the conclusion that trying to butcher the API to prevent plonkers being plonkers is just never going to work. The API should expose the rich contract of the object in question. If different layers have different views of the same model, then why not use different interfaces, all implemented by the same object (ReadOnlyUser, ModifiableUser etc.)?

    I am not saying that the API should expose every possible method, rather it should expose every *relevant* method for the usage of the object at that moment in time, regardless of the developer's skill.

    And while I don't quite believe in "breaking legs social networking" I do believe that code is a very powerful tool, and code deserves to be treated with respect....if developer's don't get that, then sure, they need training up
    I agree that butchering the API isn't the answer and I do use different interfaces. I'm still conscious however, that someone doesn't like what the interface says, finds the domain object that implements it and calls a method on my domain object anyway. If you’re using struts etc. it’s all too easy to do. As you say, this is an issue of training and discipline.

    I though this was quite interesting though.
    http://debasishg.blogspot.com/2006/0...aky-model.html

    Training people up, breaking legs...... lets not argue about semantics :-). I thought that was the hidden meaning behind *real* Extreme Programming anyway.

  2. #22
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Quote Originally Posted by karldmoore View Post
    I'm still conscious however, that someone doesn't like what the interface says, finds the domain object that implements it and calls a method on my domain object anyway.
    That's why I like proxyTargetClass="false" so much

    You probably can't do this as a concept - proxying whereever you don't want to provide access. Here I'm also more pragmatic: If a developer wants to do something stupid, he can always get it done somehow.

    But at least the places where I proxy I use JDK dynamic proxies and not CGLib proxies to prevent any casting. And so it should be more difficult to do something stupid.

    Jörg

Posting Permissions

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