BHoM / BHoM/BHoM_Adapter

BHoM_Adapter: refactoring- should all IBHoMObjects implement a default "base" comparer that when checking for equality first of all looks at the GUID?

Open
#99 2 comments 0 reactions 1 assignee Claimed by @alelom View on GitHub
type:question
Dominant language
C#
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Because I am not sure that the following is something we want (Push with RobotAdapter, which uses comparers):

![image](https://user-images.githubusercontent.com/6352844/59114900-108b7d00-8940-11e9-9deb-155daa2e75c4.png)
here node duplicates are correctly filtered out -- but that just because they have a comparer implemented.

![image](https://user-images.githubusercontent.com/6352844/59114825-ee91fa80-893f-11e9-9fa6-78faac85763a.png)
here bars duplicates are not filtered out -- even though they are have the same GUID (i.e. BHoM knows they are the same bar)

Implementing a default base comparer for IBHoMObjects that uses GUID for equality would solve this without having to manually implement a comparer for every type.
Not sure about potential side-effects though. `Replace()` and consequently Push, Pull etc should all work as usual, I think.

@IsakNaslundBh @al-fisher @epignatelli @adecler

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.