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
|