In particular for the 3rd point, I have two dilemma(s):
1)About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.
- About the link between class responsibilities and what is the best way of invoking a method call between different objects in different scopes.
EventManager is deemed to be in charge of holding a Statistics field, and holding a PriorityQueue of Events, since it's the Manager. In my implementation I could have written one of the following:
On the other hand, in B feels like its more fulfilling to responsibility. The object newEventnewEvent is the provider of the information, hence should be placed in the arguments.
I chose A in the end as during the time I found B logical, I realised I have to do ugly dispatching and I am tempted to pass back statistics as arguments to Events, in the form of newEvent.f(this)newEvent.f(this), in Statistics method updateStatisticsupdateStatistics. This just defeats my purpose of sending EventsEvents in as arguments from the start. What is your view on this dilemma of responsibility design vs the ease of coding to the programmer?