What exactly was your assignment? Just to come up with an example of OOP? Because I don't see any real mistakes in the description itself; it shows OOP. Was the UML part of the assignment, and if so how accurate does it need to be, do you need to code this out later? Because there are some mistakes in the UML. If it's supposed to be a UML you can later code off of, then there will need to be some corrections.
UML is not loading on this page but works if you go to the source for it. Here is the embedded version:
UML Feedback (not in any order, just as I notice it)
- Why does Company implement WorkingHours? Did you mean employee?
- How would workTime() function? Work has a start and end time, but there's only one function. What would be an example return value from it?
- whatIsTheDeveloperWorkingOn() is not the best method name. Perhaps getProjects() or would be better.
- You declare several variables as "set". This is not specific. A Set of what?
- You underlines the class names in the UML (all besides Project). This means they are static, I believe.
- No multiplicity is stated from project to developer. How many projects are there per developer? If there's only 1, then it can be 1 to 1. If not, it should be declared like: 1 developer to 1... project, or 1 developer to 0... projects (if they can not be working on anything).
- I'm not sure experience as an integer field makes much sense. What is 1 experience? Years?
- No return types are specified on the UML diagram. For example: getEmployeeInfo() - what does this return? A String? A custom EmployeeInfo class?
- No constructors specified. This means that your private fields can never be set in any way.
- addProject() takes no arguments. What project are you adding?
- Make sure all your fields make sense where they are. For example: what is the purpose of a Company having time?
- Company should probably have some employees. Right now it has a count of employees, but not any actual employees.
Try generating code from that UML (either using a tool or manually), and write it EXACTLY as it appears in the UML. See what you can do with it. If it doesn't function, then first make adjustments to the UML, then code exactly what it says again.