> You can't really avoid casting when you're reading a Java hierarchy off an > XML file. The important part is to limit this casting to its bare minimum > (getting the root), and Android does exactly that.
I understand the impedance mismatch of deserialization, but it's still a smell. :) The port of Guice (RoboGuice) turns this around and avoids it through DI. > I'd argue that Android's R system, which provides static type safety for > resources, is actually pretty solid. I can't count how many times I've had > regular Java code crash at runtime because a .properties or .xml file could > not be found... This can't happen on Android: the compiler will tell you > right away. Well yes, but then you are tied to the tool support of the Eclipse plugin - it's one of the significant hindrances from using other IDE's. I've often wanted a sort of dynamic Enum for the purpose (since same problem exists when you deal with I18N keys), but it needs to be baked into the language rather than be dependent on IDE/compiler. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
