sitelink1 | |
---|---|
sitelink2 | |
sitelink3 | |
extra_vars4 | |
extra_vars5 | |
extra_vars6 |
·미리보기 | 소스복사·
- public User findUser(String userId) throws UserNotFoundException {
- if(log.isDebugEnabled()) {
- log.debug("findUser() 시작");
- log.debug("User ID : " + userId);
- }
- User user = null;
- StopWatch clock = new StopWatch("Profiling ...");
- try {
- clock.start("findUser()");
- user = userDAO.findUser(userId);
- } finally {
- clock.stop();
- }
- if(clock.getTotalTimeMillis() > 500) {
- if(log.isWarnEnabled()) {
- log.warn("Execution Source : UserDAO.findUser()");
- log.warn("Execution Time : " + clock.prettyPrint());
- }
- }
- if(log.isDebugEnabled()) {
- log.debug("findUser() 종료");
- }
- return user;
- }
회색 박스안의 코드는 실제 비즈니스 로직이 아니다.
이 코드를 따로 분리해서 관리할 수 있다면...