Better Buttered: A look at Butter Knife, a View "injection" library for Android

Code injection is usually something we try and avoid, but Jake Wharton of ActionBarSherlock fame (along with many other great open source Android libraries) is using injection for good.  With his open source “Butter Knife” library, you can use annotations to conveniently create commonly used code for Views in Android.  Let’s take a look at how to implement it into your project today.


by dmitri

For a client I had to implement spring based startup module. The module's context xml file simply defines annotation-config and component-scan element and doesn't define any bean. When I add 50-th bean into the module, I reliazed I can't manage dependencies without painting them anymore.


The fast search had lead to 3 nice tools: SpringSource Tool Suite, BeanDoc and Maia EAP. Each one of them may analyze dependencies and may paint them. But no one of them may deal with annotations.