The current architecture of ConverterService is such that if I want to convert to/from an object of a given class, I subclass ConverterService. Well, what if I want to convert to/from several classes? In my subclass, I could do an:

        if ( obj instanceof MyClass1 ) {
            // ...
        } else if ( obj instanceof MyClass2 ) {
            // ...
        } else ...

which is (a) tedious and (b) means I have to have my subclass know about lots of classes (bad design, IMHO).

So instead, why doesn't Application instead have a:

        Map<Class,ConverterService>

so then the code to to conversion would look up the right ConverterService based on the class of the object being converted?

- Paul

Reply via email to