Questions tagged [google-guice]

Google Guice is an open source dependency injection framework for Java, developed by Google. _Description courtesy of [Wikipedia](http://en.wikipedia.org/wiki/Google_Guice)_

Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

Can I use a library that uses guice to bind contact and implementations in applications without issues?

I have a play application and want to take a common operation out from the application and make it as a library in order to use in other play applications. This proposing library has a contract(...
udayanga's user avatar
  • 113
1 vote
2 answers
269 views

Opportunity cost of DIY DI?

Java here. I have always used Spring DI (for Spring projects) or Guice (for non-Spring projects) for dependency injection, and have always loved them. I recently took a job where they do 100% "DIY DI"...
smeeb's user avatar
  • 4,800
9 votes
2 answers
738 views

Gradually move codebase to dependency injection container

I have a large codebase with a lot of "anti-pattern" singletons, utility classes with static methods and classes creating their own dependencies using new keyword. It makes a code very difficult to ...
damluar's user avatar
  • 217
55 votes
4 answers
17k views

Why do we need frameworks for dependency injection? [closed]

I've been reading up more on the Inversion of Control principle and Dependency Injection as an implementation of it and am pretty sure I understand it. It seems to be basically saying 'don't declare ...
timsworth's user avatar
  • 661
1 vote
3 answers
6k views

How to use Guice for an effective API Design?

I am creating a base API in JavaSE, which includes modules like MVP architecture, Service & Repository Layer, Event Model to fire events between presenter etc. I am trying to implement all best ...
Akshat's user avatar
  • 119
1 vote
1 answer
70 views

Do my "dal" and "fileHandler" interfaces overlap?

I want my program to: read some input lines from CSV file write the output lines to plain string file read some input from the same file in (2) and compare it to some calculated data I want to ...
user23621's user avatar
  • 181
8 votes
4 answers
2k views

What complexity do DI frameworks add?

The currently most upvoted answer to a very recent question states that DI containers are an "enterprise software" pattern, used when the object graph is very large and complex. I suspect ...
maaartinus's user avatar
  • 2,623
3 votes
3 answers
998 views

Where should I put bindings for dependency injection?

I'm new to dependency injection and though I've really liked it so far, I'm not sure where bindings should go. I'm using Guice in Java, so some of what I say might be specific to just Guice. As I see ...
sinθ's user avatar
  • 1,311
6 votes
1 answer
9k views

Passing a Context around with dependency injection

In the project I'm working on, I'm using Guice and trying to do as much as possible with Dependency Injection. However, there's one little snag; many of my objects rely on an object Context. This is ...
durron597's user avatar
  • 7,550