-->
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: ClassValidator with different ResourceBundles
PostPosted: Tue May 16, 2006 9:43 pm 
Newbie

Joined: Thu Jul 21, 2005 10:19 pm
Posts: 13
Why does the ClassValidator takes the ResourceBundle with its constructor?

Now if we find ourselves in the situation to validate with different locales we have to create a ClassValidator instance in cache for each different Class and ResourceBundle pair... (thats what Seam does, right?)

It would be easier to not do so... simply caching a Validator instead of each possible pair. I suggest the following refactorings that keep validator compatible with older versions (I can send a patch also): extracting the ClassValidator code to another class (let's say SimpleClassValidator), keeping its ctors, using composition.

The SimpleClassValidator contains the same methods that ClassValidator has except that its methods takes the ResourceBundle as a parameter (introducing the new parameter).

I understand this makes almost every method receive a ResourceBundle parameter... so... any ideas?

Hibernate version: since beta 9

_________________
http://www.caelum.com.br
xstream, paranamer and waffle .codehaus.org


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 6:08 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
We pre-calculate and cache the message string to be more efficient

_________________
Emmanuel


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.