I am quite happy with you current proposition. It seem to be flexible enough to allow compound converters, while also being simple enough to make your own converter. And there is only one interface, which is IMHO a lot better and a lot less confusing than current IConverter and ITypeConverter stuff.

-Matej

Johan Compagner wrote:
that is not a problem. just add youre String.class converter to the "compound" session Converter
Or override getConverter() and return yours.

you now know what is outgoing and incomming with that interface so that shouldn't be a problem
But when the trunk is ready for 2.0 code. Lets test it out and evolve.

johan


On 5/16/06, *Alexei Sokolov* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Johan,

    It would be nice to have an ability to convert from string to string
    for fields like phone numbers, zip codes, ssn, etc.

    Alex


    On 5/14/06, * Johan Compagner* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:

        Hi,

        first currently we have IConverter and ITypeConverter , i want
        to combine those 2 to be one interface
        And then a converter must be easy to make but also to understand.

        So i can do this:

        IConverter.convertToObject (String, Class)
        IConverter.convertToString(Object)

        Then writing a DateConverter is pretty simple, you have one
        SimpleDateFormat (or more per locale)
        and then in toObject you do parse and in toString you do format

        The thing is we loose a bit of the more "generic" nature we have now
        because in the current setup we could do:

        conveter.convert(new Double(10), Integer.class) to convert from
        a double to a integer.
        Do we need this? We could make:

        IConverter.convertObject(Object, Class) instead of
        IConverter.convertToObject(String, Class)
        besides to convertToString.

        But that would complicate converters again.

        That Class param can be ignored by a Converter impl (or it could
        check if it was the type for which this converter is build.)
        But having that class param there then it is possible to make a
        compound converter and only have one interface
        so that you can much easier make youre converter for a specific
        textfield.

        johan







-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to