Skip to content

Instantly share code, notes, and snippets.

@billybong
Last active August 23, 2018 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billybong/571dbd8062127b8a6720bcdaaaacb852 to your computer and use it in GitHub Desktop.
Save billybong/571dbd8062127b8a6720bcdaaaacb852 to your computer and use it in GitHub Desktop.
DI without framework, Java
interface Factories {
default Optional<MyService> myService(){return Optional.empty();}
default Optional<RemoteApi> remoteApi(){return Optional.empty();}
static Factories factories(){return new Factories(){};}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment