Given a class like:class State {    bool IsLessThan(State);    int data;};The State::IsLessThan(State) method can simply compare data in each class according to some logic. However let's say the data within State is expected to change throughout development and hold different predefined types of data groups which the client decides to add to the state. One way to implement this is:class State {    void Add(StateData);    bool IsLessThan(State);    Set<StateData> data;};Where any derived class of StateData can be thought of as a struct with some data. Assume that if a State does not contain a type of StateData, it has an instance created with default values. Every time a new type of StateData is added to the program, the logic and therefore code in State::IsLessThan(State) will need to be changed. Assume that the main concern here is architecture extensibility. Can this be improved? Am I missing a better solution?
How to compare objects with expanding amount of data?
object oriented;c++;architecture