Hello Tania,
this could be a moot point, and I am not sure whether it suits your
needs but I liked this idea:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-valframe.html
alex
Friday, July 12, 2002, 9:20:02 PM, you wrote:
TGR> Hi,
TGR> I was thinking about the several ways that exist to validate a field
TGR> value....
TGR> I had some ideas, but I was wondering if there is a pattern that does it...
TGR> In my entity bean, I am using the pattern VO and when I'm setting the cmp
TGR> fields,
TGR> I wanna make a validation of some fields but I don't want to put this
TGR> validation inside
TGR> this method.
TGR> Ex:
TGR> public void setDVO(ArrayDVO pmtDvo)
TGR> {
TGR> setName((String)pmtDvo.getFieldByName(this.ATTR_02));
TGR> setAge((Integer) pmtDvo.getFieldByName(this.ATTR_03));
TGR> setAddress((String)pmtDvo.getFieldByName(this.ATTR_04));
TGR> }
TGR> In this case, I would like to validate if the age value is a correct
TGR> number..... but I don't want to put
TGR> this validation inside this method setDVO().
TGR> The way I was doing was:
TGR> creating the method setVldAge(Integer age) and inside this
TGR> method, after validating it, I used
TGR> to call the setAge..... and in the method setDVO() I was calling the
TGR> setVldAge(..) instead of calling the
TGR> setAge(..)
TGR> But, I don�t think that this is the best alternative...
TGR> I think that using a pattern would be a better solution....
TGR> How do you usually validate these fields?
TGR> Thanks,
TGR> T�nia Ramos
TGR> Analista de Sistemas - NDS
TGR> * [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
TGR> F�ton� Inform�tica e Servi�os
TGR> * Fone: (61) 328 5060 R.240
--
Best regards,
Alex Loubyansky
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Gadgets, caffeine, t-shirts, fun stuff.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user