HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
google
guice
Java2015–2025
google / guice

guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.

15Distinct people
15Mentions
0Explicit recommenders
12.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year15 dated mentions

Observed mentions: 2015-09-16 22:39:59 UTC to 2025-05-26 13:05:10 UTC.

01232015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC110
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

15 sources
I meant "singleton" in the sense of a single value for a type shared by anything that requires one, i.e. a Guice singleton ( https://github.com/google/guice/wiki/scopes#singleton ) not a value in global scope. Or maybe a single value by type with an annotation, the salient point is that there are values in a program that must be shared for correctness. Parameterless constructors prohibit you from using these (unless you have global variables).
In Dependency injection frameworks add confusion
Guice docs: “There are many advantages to using dependency injection, but doing so manually often leads to a large amount of boilerplate code to be written. Guice is a framework that makes it possible to write code that uses dependency injection without the hassle of writing much of that boilerplate code” This is a common misconception. Guice’s docs delineate between dependency injection as a pattern and Guice as a framework that supports that pattern. https://github.com/google/guice/wiki
In Inversion of Control Containers and the Dependency Injection pattern (2004)
> Dependency injection has always been such a bad name for the concept. It is just passing dependencys as arguments. No. Dependency Injection means using tooling to "inject" the dependency, instead of passing an explicit argument. https://github.com/google/guice > Think of Guice's `@Inject` as the new `new`. Like many architecutral design patterns, toy examples don't illustrate the concept well. It's used for doing things like switching a large service-based system from using external databases and remote services for production, to in-memory everything for testing.
In Inversion of Control Containers and the Dependency Injection pattern (2004)
Bob was a nice guy. We had an overlapping tenure at Google in the 2000s. He was one of the original authors of the Guice dependency injection framework: https://github.com/google/guice. When I was earning Java readability at Google, I was fortunate to have had him assigned as a reviewer. Having the review work so smoothly alleviated a lot of the imposter syndrome I felt at the time. I felt like a million bucks afterwards. The compassion and humility he brought to the table made a world of difference. His murder represents a huge loss; he left a very positive impression on me.
In Remembering Bob Lee
Re: static factory methods - Those are called just once (so perf isn't really the point). With respect to non-perf reasons, Factories should also be non-static. Here's why: 1. Factories that are part of a dependency injection framework (Guice, Dagger, Spring) are actually "objects" that the DI framework is moving around. These DI frameworks already enforce object creation (see: https://github.com/google/guice/wiki/GettingStarted for example -- everything is an object). 2. public static factory classes have significant disadvantages (eg. depending on another factory class is a direct, "hardcoded" brittle dependency). Avoiding this is straightforward - create factory objects (aka Modules) and register it with the DI framework (the only public static "singleton" object) - when an object is needed, ask for it and the DI framework will give it
Read the rest
to you (implicitly through the factory).
In Public Static Is Harmful
xendo·Jan 17, 2022Submission

Ask HN: Google Guice another abandonware from Google?

It's been already 4 months since JDK17 was released, but Guice (one of the most popular Java dependency injection frameworks) still didn't release required compatibility changes [1]. There looks to be zero contact with maintainers at Google. In the meantime Spring was ready for JDK17 in July (3 months before JDK17 GA) [2] For years I advocated to use Guice at my companies, as it's considerably less bloated than Spring. Now I'm starting to get some heat on this as it's clear that the support is just not there. Is this the right time to accept the defeat and start migrating back to Spring? [1] https://github.com/google/guice/issues/1536 [2] https://twitter.com/snicoll/status/1420652097373188100
13 points · Open discussion
> it specifically guards against inheritance/factory/DI hell by offering a unique type system Many people, including Google engineers (https://github.com/google/guice) see DI as useful tool, not hell. But nothing prevents you to write your java code without DI if you don't like it.
In Hello Go
Thank you, and of course you may. The backend is written in Java(8) and it is built with the following (noteworthy) components : Netty[1] - Extremely fast and stable Java networking framework, serves static files and relays traffic (both tasks are custom implementations) Guice[2] - IoC container by Google, nice for keeping the code clean jOOQ[3] - I log some statistics in PostgreSQL (file size, content type, transfer time - but no filenames). If you're comfortable with SQL jOOQ is a real breeze to use. The backend is hosted on the cheapest VM option at Digital Ocean (Amsterdam region), (which seems to be holding up pretty well so far :). I do run PostgreSQL on another $5 VM, so the Station307 server only has to worry about serving static content and moving large chunks of bytes
Read the rest
around. SSL certificates are kindly provided by Let's Encrypt[4]. For the frontend, I know for a fact it uses left-pad (babel-core)... Written in JavaScript (ES2015 + JSX) and built with : Mithril[5] - Fast, small and simple React-like framework, quite a joy to use. Bootstrap[6] - Because not having to worry about L&F is quite nice. Trimmed it down a bit by only importing the parts I needed (SCSS). And I think that's about it. If there's anything else you'd like to know, let me know! [1] http://netty.io [2] https://github.com/google/guice [3] http://www.jooq.org [4] https://letsencrypt.org [5] http://mithril.js.org [6] https://getbootstrap.com edit: formatting D:
In Show HN: Station307 – Stream files between cURL, Wget and/or browser
> First: constructor calling is not readable because Java misses named parameters. It's fine when there are 2-3 dependencies, but not more. If you have more than 2-3 dependencies, it might be time to refactor things, as your class may be doing too many things. > Second: circular dependency is not possible. Circular dependencies are possible with constructor injection when using a DI framework (e.g., using a Provider in Guice [1], or the equivalent in Dagger). [1] https://github.com/google/guice/wiki/CyclicDependencies
In Better Java – Resources for Writing Modern Java

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.