Antares_Simulator
Antares_Simulator copied to clipboard
Binding constraints groups: enforce consistency at construction
Description
#1388 introduced objects to represent groups of constraints. A pain point is that the developer who creates a study must ensure himself that the list of BCs and the list of groups are consistent.
Instead, the study class or an inner class should guarantee that when we add a BC, it also populates the corresponding group. This, way consistency is always guaranteed.
A possible implementation would:
- make the BC and group repositories private in the
Study
class - only publicly expose an
addBindingConstraint
method in theStudy
class, and getters for BCs and groups
Note
This actually is not at all an isolated case, we need to improve the overall consistency guarantees in the whole data model.
(see for ex. Area
class, etc)