Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base_oM: make BaseComparisonConfig IImmutable #1589

Closed
alelom opened this issue Jan 23, 2024 · 1 comment
Closed

Base_oM: make BaseComparisonConfig IImmutable #1589

alelom opened this issue Jan 23, 2024 · 1 comment
Assignees
Labels
type:feature New capability or enhancement

Comments

@alelom
Copy link
Member

alelom commented Jan 23, 2024

Description:

This would be a good idea in general, in order to ensure that no external modification happens after an instance of ComparisonConfig is given to diffing/hash.

Additionally, if we introduce #1587 , the properties stop being fully orthogonal, as UseGeometryHash is not fully compatible with the other configurations (unless proven otherwise -- requires further investigation). In this case, Immutability becomes a requirement.

Introducing IImmutable in the BaseComparisonConfig requires the following:

  1. Change all collections to ReadOnly collections. This is to avoid tampering with the collections themselves.
  2. Normally, a ReadOnlyCollection would be enough, but it's better to introduce a ReadOnlyHashset for BaseComparisonConfig in order ensure optimisation when computing Hash/Diffing. This requires introducing this new class in the Base_oM. Example implementation here.
  3. We need to align all repos to this change, introducing constructors. This includes Revit_Toolkit and DiffingTests_prototypes.

@pawelbaran FYI

@alelom alelom added the type:feature New capability or enhancement label Jan 23, 2024
@alelom alelom self-assigned this Jan 23, 2024
alelom added a commit to BHoM/DiffingTests_Prototypes that referenced this issue Jan 23, 2024
alelom added a commit to BHoM/DiffingTests_Prototypes that referenced this issue Jan 26, 2024
alelom added a commit that referenced this issue Jan 26, 2024
alelom added a commit to BHoM/DiffingTests_Prototypes that referenced this issue Jan 26, 2024
@alelom alelom closed this as completed Jan 29, 2024
FraserGreenroyd pushed a commit to BHoM/DiffingTests_Prototypes that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant