.. (לתיקייה המכילה) | ||
Why is there "HardwareOrganizationalUnit" and "OrganizationalUnitWithHardware", and how do they relate? | |
OrganizationalUnitWithHardware is an interface. It's in the provided package. HardwareOrganizationalUnit is a class which should implement that interface, and you are required to write it. |
When assigning managers and adding employees, what does it mean "there is no such employee in the entire organization"? | |
1. People are considered "the same" if they have the same name, and are of the same kind (employee/manager/safety inspector) 2. An organization is a directed tree of organizational units (with or without hardware). You can assume you will only get those (single root, no cycles). 3. When assigning a manger or adding an employee, you have to make sure that there is no such person in the entire organization. You have to check not only this OU and its sub-units, but the entire tree, from the root. Also, note that a Manager can be either the manager of OU, or assigned as a regular employee to an OU. |
Is OrganizationalUnit's acceptForPersonnel recursive? | |
No. It's no recursive, and it shouldn't run from the root of the organization. It should work only on the personnel of the current OU (including the manager). |
Can we assume the the implementations of Hardware have equals and hashCode which are implemented according to the equals & hashCode convention? | |
Yes, you can assume they are implemented correctly. Their implementation is based on getId(). |
A clarification on the relations between the manager of the OU and the employees of the OU. | |
The manager and the OU and the employees of the OU are almost unrelated. The manger can be assigned/replaced/removed only by calling assignManager, and employees (even employees of type Manager) can be added/removed only by addEmplyee/removeEmployee. The manager and emplyees of the OU (a group of people which is often referred to as "Personnel") act a a single group only when checking for duplicate people (in assignManager and addEmployee), and in acceptForAllPersonnel. Therefore: 1. If a Manager is added via addEmployee he does not become the manager of the OU. 2. If a manager is replaced via assignManager, he does not become a regular emplyee 3. removeEmployee can't remove the manager |