Created
May 25, 2011 12:22
-
-
Save eranharel/990857 to your computer and use it in GitHub Desktop.
Don't copy this implementation please :P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmployeeServiceSingleton { | |
private static final EmployeeServiceSingleton instance = new EmployeeServiceSingleton(); | |
private final EmployeeDao employeeDao; | |
private EmployeeServiceSingleton() { | |
employeeDao = ServiceLocator.getEmployeeDao(); | |
} | |
public static EmployeeServiceSingleton getInstance() { | |
return instance; | |
} | |
public String findManagerName(final Long employeeId) { | |
if (null == employeeId) { | |
throw new IllegalArgumentException("employeeId must not be null"); | |
} | |
return employeeDao.findManager(employeeId).getName(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment