On Thu, 2007-06-14 at 11:18 +0200, Jiri Mares wrote:
> >>>> you have to encapsulate to code into one method to be able to change it
> >>>> easilly, nothing more ...
> >>> Sorry, but I don't understand what you want to say with this...
> >> The code adding the field error have to be on one place, not spread
> >> through whole application to be easilly changed when
> >> the future versions of Tapestry will require.
> >>
> >> Eg. method:
> >>
> >> void addValidationError(HibernateValidateException ex) {
> >> Field f = new MyField(getFieldNameFromValidateException(ex));
> >> recordError(f, getErrorMessageFromValidateException(ex));
> >> }
> >>
> >> This method you would invoke everywhere where the validation exception is
> >> catched, so when the change will be necessary,
> >> anly this method will be changed.
> > Yes, but as I already said previously, IMHO this is not really solid:
> > what do you do when T5 starts using the equals method of the Field
> > in some way? Or it would start to use other informations - ok, there is
> > not much in the Field - but according to the interface it would be
> > totally legal... Do you see my point?
>
> Yes, I understand ... then the addValidationError method would in some way
> look up the Field instances via Page and the
> name ...
Ok, solution for this case ;)Cheers, Martin > > Jirka > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Martin Grotzke http://www.javakaffee.de/blog/
signature.asc
Description: This is a digitally signed message part
