I've got one requirement that is:
When one employee starts working on a project and when he finishes working on it he must inform the system so that it can generate a report afterwards of how much hours a certain project required.
The requirement itself is simple, I just want to see if I'm thinking right about it. My initial idea was an event based approach: when the employee starts working on it one event is raised informing that, and when the employee finishes working an event is raised informing that.
On the end of the day, to count the hours needed for a given project we just need to retrieve the relevant events and compute time spans and sum them up.
There are some loose ends still, however. For instance, finding a way to connect two such events so that we know that one refers to work started and the other referes to the ending of that started work. My idea was to make one event hold a reference to the other, but I don't know if this is usually done.
By the way, the other approach I thought seemed to bloat the employee class. It was basically to make the employee class hold a reference to the project the employee is currently working on, and a property refering to the work start time. When it is finished, just one entry for the timespan is recorded on the project.
The second approach is much simpler but it seems to add responsibilites to the employee class, I'm unsure though.
Is the event approach really the most natural and simpler approach here, or going to one event approach is overengineering and just making the employee class responsible for managing this the simpler approach?