On 8 December 2010 09:30, Vince O'Sullivan <[email protected]> wrote:
> On Dec 7, 11:22 pm, Liam Knox <[email protected]> wrote: > > I have heard from several candidates that I have interviewed that Credit > > Suisse, on Java, forbid any use of Reflection by their developers and are > > anti-Spring. > > I can't comment on Spring but I agree on the policy regarding > reflection in an end user company. It has uses in explorative > programming (i.e. where you're trying stuff out to see what will > happen) but not in production code (at least not in the kinds of "real > world" applications that Credit Suisse produce). > > Reflection in application code is a symptom that the programmer is > using some kind of undocumented feature or backdoor trickery. > > Reflection can be valuable and it does have a use, particularly if you're running up against limits of the Java type system (e.g. you need an API that can work on *any* object exposing a `close` method), or perhaps need to implement some custom serialisation of objects from a third party library. It's still backdoor trickery, but it's backdoor trickery in the face of no other possible alternative... If you really do need it then reflection should best be kept on a tight leash, preferably tucked away in your own library and not used in day-to-day coding. That said, if you're writing a library yourself then this argument loses much of its strength :) -- Kevin Wright mail / gtalk / msn : [email protected] pulse / skype: kev.lee.wright twitter: @thecoda -- 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.
