Antares_Simulator icon indicating copy to clipboard operation
Antares_Simulator copied to clipboard

Binding constraints groups: enforce consistency at construction

Open sylvlecl opened this issue 1 year ago • 0 comments

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 the Study 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)

sylvlecl avatar Aug 04 '23 16:08 sylvlecl