Skip to content

Instantly share code, notes, and snippets.

@eranharel
Created May 25, 2011 12:22
Show Gist options
  • Save eranharel/990857 to your computer and use it in GitHub Desktop.
Save eranharel/990857 to your computer and use it in GitHub Desktop.
Don't copy this implementation please :P
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