title: Butterknife View injection
body: <p>I stumbled across a very interesting Dependency Injection library called <code>ButterKnife</code>. Using <code>ButterKnife</code> it's easily possible to inject Views into activities or fragments.</p>
  
  <pre><code>class ExampleActivity extends Activity {
    @InjectView(R.id.title) TextView title;
    @InjectView(R.id.subtitle) TextView subtitle;
    @InjectView(R.id.footer) TextView footer;
  
    @Override public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.simple_activity);
      ButterKnife.inject(this);
      // TODO Use "injected" views...
    }
  }
  </code></pre>
  
  <p>However if using Dependency Injection those Views must be <code>public</code> so that <code>Butterknife</code> can inject it (using <code>private</code> fields results in an exception <code>fields must not be private or static</code>).</p>
  
  <p>In my past project I always made all the member fields (including the views) <code>private</code> as I thought this is best practice (information hiding etc.) Now I am wondering if there is a reason why one should not make all the views <code>public</code>? In this case I cannot use <code>ButterKnife</code> but I want to use it because it simplifies the code a lot.</p>