[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-1004 and JBCACHE-1005

supi do-not-reply at jboss.com
Sun Apr 8 10:05:32 EDT 2007


"manik.surtani at jboss.com" wrote : Well, one workaround is to use a return type rather than a cast, which is valid:
  | .

"jason.greene at jboss.com" wrote : 
  | You don't need to do this. Since a DI framework does this at runtime the generics info is irrelevant. So you can declare the injected type to be whatever you want.

Ok, there will be all kinds of workarounds (subclasses, wrappers, getters etc.) at compile time or (type-less) wiring at runtime that make me think: what's the point? The only benefit I see is type-safety that affects about 2-3 users who only put one kind of objects into the cache. Everyone else has to deal with this new inflexibility in their own way, potentially introducing new bugs, clumsy workarounds, unreadable code, unsafe code (e.g. disable unchecked warnings in whole methods), etc. And lets not forget the cache library itself. More letters, less readable code => more bugs.

In my opinion, at this point a step in the wrong direction.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035593#4035593

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035593



More information about the jboss-dev-forums mailing list