Class Controller;
//Handles communication outwards, keeps track of internal state
public:
UpdateControllerState();
private:
ManageResponse(); etc.
Class EventRecord;
// Keeps a pre-defined number of events in a list, keeps track of when and how many times these events occur
Public:
UpdateEvents();
GetEventData(); etc.
Private:
RegisterEventTrigger();
Class EventHistory;
// Keeps a separate list of the history of the events triggered.
Public:
RegisterTriggeredEvent();
ClearEventHistory();
GetEventHistory();
So, the class Controller needs access to both the EventRecords and EventHistory to read out these lists, and to trigger UpdateEvents().
Meanwhile, EventHistory needs access to the RegisterTriggeredEvent() method to register a triggered event in the history list.
How do i organize this in a coherent way? Do i make an "EventHistory" object as a public member of EventRecords, and access it "through" EventRecords from the controller, or do i do it in another way? Or do i simply include the functionality of "EventHistory" in the EventRecords class instead of making a separate class for it?
You forgot to mention who owns what. From your second paragraph I assume that an EventRecord holds some number of EventHistories.
It seems that RegisterEventTrigger() is the only private member function that needs to be accessed by other classes. Is there any reason why it should be private?
As for how a Controller should access EventHistories, the question is: should Controller know about EventHistory, or is the existence of EventHistory an implementation detail of EventRecord?