Eelco,  You mentioned making AbstractValidator#validate(...) final, but you must have meant that the standard wicket subclasses would have their #validate method made final.  That would be great as long as I can override the errorMessage methods.  :-)
 
I also greatly approve of your suggestion that error messages may not always come from a ResourceBundle (properties file).  In the future I have hopes to create a user-administered translation system where users with translation rights can add and modify translations via the standard web interface.  (Translation-enabled users would see an extra link -- a question mark -- that would let them translate or change that text)
 
Thanks!
 
Jonathan


>>> [EMAIL PROTECTED] 2005-01-15 3:37:28 AM >>>
I think Jonathan (Carlson) is right on this. If he wants to override
e.g. PatternValidator in order to provide his own implementation of the
errorMessage method (errorMessage(input, component)), that's really
understandable.

I propose to make the validate methods final of the AbstractValidator
subclasses, and remove the final tag from the classes. The alternative
would be to fiddle with pre-post fixes etc, but I really the template
methods of AbstractValidator as a user, and having a focus on resource
keys (who say's everyone will get their messages from resource files
anyway) will also blur things.

Eelco

Jonathan Locke wrote:

>
>
> Jonathan Carlson wrote:
>
>> (I am using CVS as of last Monday or so)
>> 
>> In order to use the cool new errorMessage(...) methods in
>> AbstractValidator, I would like to suclass RequiredValidator and
>> PatternValidator (and probably others as well) to provide my own
>> error resourceKey and resourceModel map.
>> 
>> However, the AbstractValidator subclasses are final.  Could we please
>> open these up or else provide a way to provide our own resoruceKey
>> and resourceModel without subclassing?  (Like maybe with getters and
>> setters).  I was willing to copy the logic from RequiredValidator to
>> my own validator class, but the PatternValidator is more complex and
>> I really shouldn't have to copy all that stuff, right?
>
>
> btw, for anyone who has been wondering about the usefulness of
> defensive programming with final, private, etc... this is a perfect
> example.  there's possibly some use case here we didn't anticipate. 
> if these classes had been extensible, there might be dozens of people
> out there subclassing them in order to implement functionality that we
> might ultimately decide should be part of the API.  and with all those
> unanticipated subclasses to support, we'd have very little flexibility
> to change our AbstractValidator subclasses in the future without
> breaking the world.
>
> anyway, what problem are you trying to solve, jonathan?
>
>> 
>> I'm curious about your response.  Thanks!
>> 
>> - Jonathan
>>
>>
>> **********************************************************************
>> This email and any files transmitted with it are confidential and
>> intended solely for the use of the individual or entity to whom they
>> are addressed. If you have received this email in error please notify
>> the system manager.
>>
>> www.katun.com
>> **********************************************************************
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to