Skip to content

Instantly share code, notes, and snippets.

@shibli049
Last active February 4, 2018 06:39
Show Gist options
  • Save shibli049/41ad6111b6c154332c9659e402925563 to your computer and use it in GitHub Desktop.
Save shibli049/41ad6111b6c154332c9659e402925563 to your computer and use it in GitHub Desktop.
// Which dependency-injection/autowiring option is better, why?
public class SpringAutowire{
@Autowire
private ClassA a;
private ClassB b;
private ClassC c;
@Autowire
public SpringAutowire(ClassB b){
this.b = b;
}
@Autowire
public void setC(ClassC c){
this.c = c;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment