However, the Endurantism approach might be more suitable to what we are looking for – the Endurantism approach offers a way to maintain the whole object history (in the sense of changes in its temporal properties) within itself, and therefore, we could use this approach as our model for the proposed philosophy-based pattern.
According to Endurantism approach, there is no direct relation between a property (parameter) and its value, but rather a relation between a property (parameter) and a list of “time interval”–“value” pairs. This means that when we activate an object’s method that uses such a parameter (implemented according to the Endurantism approach), or when we directly approach such a parameter, we have to be clear about the time interval that is relevant for the request.
As described in the UML diagram, the essence of a history-managed parameter (HistoryManagedParam) is a list of TimePeriodValuePair objects, where each TimePeriodValuePair is actually a pair of a ParamValue object, which contains the value itself, and a DateTime object, which indicates the time period in which its pair mate (the value) is valid. The parameter object itself could be attached to any type of object (HistoryManagedObject in the diagram).
When there is a need to create a new value for a certain parameter (for example, the person weighed 70 kg in 1.1.2010 and 71 kg in 2.1.2010), we use the HistoryManagedParam.AddValueByPeriod method in order to add another ParamValue-DateTime pair to the HistoryManagedParam list of pairs.
And when there is a need to perform a certain task that involves such a parameter, we get the relevant value by using the HistoryManagedParam.GetValueByPeriod method, which returns the relevant ParamValue according to the desired time, which it gets as its input.