Tag: Dependency Injection

Blog List: Adding a Blog View Activity, Butterknife, and Dagger

Today I’ll be modifying the Blog List example to add a blog view activity, and utilizing Dagger for dependency injection and Butterknife for view injection.

Also, if you’ve been following along with my Blog List series, you’ll noticed the code has gone through a bit of refactoring in this iteration. Specifically, I’ve gotten rid of the VolleyBlogPostRequest and BlogPostListener in favor of anonymous inner classes. This allowed me to keep the list of blog posts available for the ListView’s onItemClickedListener.

So, being introduced today:

  1. Navigating from one activity to another
  2. Butterknife
  3. Dagger

Continue reading

Inversion of Control with Spring

What is Spring?

Spring is an Inversion of Control (IoC) container, which means it uses Dependency Injection (DI) to provide dependencies to classes. For example, let’s say we have a class EventService that has a dependency on a Data Access Object (DAO). Here’s EventService without an IoC container: Continue reading