Human Resources Example - HRManager Class methods
Each of these classes represents a simple POJO that doesn't implement any special interfaces. The most important class is HRManager, which represents the service entry point providing all of the public methods that clients will call. Methods Provided by the HRManager Class addEmployee(Employee employee) removeEmployee(Employee employee) getEmployee(String firstName, String lastName) getEmployees() getSalary(Employee employee) setSalary(Employee employee, Integer newSalary) isHiringFreeze() setHiringFreeze(boolean hiringFreeze) getSalaryStrategy() setSalaryStrategy(SalaryStrategy strategy) The Human Resources Service is composed of a handful of classes which maintain a list of employees and their details (addresses and salaries, in this case). Using the SalaryStrategy interface it is possible to configure the HRManager so that different salary strategy implementations are available to place minimum and maximum limits on the salaries for different employee roles.