-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Pattern/Idiom for hiding validation annotations ?
PostPosted: Wed Dec 09, 2009 6:29 pm 
Newbie

Joined: Tue Aug 09, 2005 8:06 pm
Posts: 6
So, I'm fairly familiar with JSR-303 and have used GWT-Validations. I'm now looking into using the latest Hibernate Validator...

I have these very dumb DTO's, that I eventually want to validate.

Is there an idiom for hiding the annotation based validation of said DTO's from a client user? We're not trying to be secret, we're just trying not to confuse novice (or novice to Java)users, and we plan to document most validation at the API/Java doc level.

Would it be possible to define the DTO without annotations, then define a ValidatableDTO subclass that exists only on the app tier(and would be easy to copy values from the regularDTO and the Validatable one), and put the annotations on the getters(thus overriding the getter with the exact same implementation)?

Note that I prefer not to use the XML validation descriptors.

I figure either:
a) I'm trying to do something that the current design doesn't support.
b) What I'm proposing(overriding getters) won't work or is too kludgy for any self respecting Java developer to advocate.
c) There is a much easier way to do what I want to do... lol

Anyone have any suggestions?


Top
 Profile  
 
 Post subject: Re: Pattern/Idiom for hiding validation annotations ?
PostPosted: Wed Dec 09, 2009 7:48 pm 
Newbie

Joined: Tue Aug 09, 2005 8:06 pm
Posts: 6
Drat... did I post to the wrong forum? Should I move my post to the Validator/Shard/Optional package forum?

Feel free to correct me if I'm wrong.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.