Skip to content

Instantly share code, notes, and snippets.

@SeongUgJung
Created February 28, 2015 01:28
Show Gist options
  • Save SeongUgJung/510437b16c0f27bcb729 to your computer and use it in GitHub Desktop.
Save SeongUgJung/510437b16c0f27bcb729 to your computer and use it in GitHub Desktop.
지역변수 DI 하기..
void doSomething () {
IUserSessionDao dao = getUserSessionDao(isParents);
// 생략
}
IUserSessionDao getUserSessionDao(boolean isParents) {
IUserSessionDao userSessionDao;
if (isParents) {
userSessionDao = (IUserSessionDao) applicationContext.getBean("parentUserSessionKeyDao");
} else {
userSessionDao = (IUserSessionDao) applicationContext.getBean("childUserSessionKeyDao");
}
return userSessionDao;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment