You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #13 all algorithm objects currently are leaking implementation details by making the dictionaries public properties.
To be able to depreciate the direct access to the dictionaries in the future, new methods should be added to the algorithms for getting values in the dictionaries.
In some algorithm objects there already is a TryGetColor for getting vertex colors. This approach should be used in all algorithms.
One thing to consider is if we also should have a TryGetXWithDefaultValue where a default value is returned if the vertex isn't found. It could cut down on boiler plate code for callers if they always want a value, but I'm not sure how important this is right now.
The text was updated successfully, but these errors were encountered:
When using the TryGetX naming I don't think we should throw exceptions since that would not be in line with how the functionality works with standard dictionaries. I do agree that setting the default value as part of the TryGetX makes sense.
Question is if we also should have a GetX method that does throw if the key doesn't exist?
So we have both TryGetX that never will throw and TryX that does throw if the vertex doesn't exist / isn't accessible.
Yeah you're right, that better fit the TryGet approach. In this case there are some implementation that may need to be updated. I was thinking about TryGetColor.
Considering the fact that TryGet does not throw having a Get version seems cool, like we have Parse and TryParse etc.
As discussed in #13 all algorithm objects currently are leaking implementation details by making the dictionaries public properties.
To be able to depreciate the direct access to the dictionaries in the future, new methods should be added to the algorithms for getting values in the dictionaries.
In some algorithm objects there already is a
TryGetColor
for getting vertex colors. This approach should be used in all algorithms.One thing to consider is if we also should have a
TryGetXWithDefaultValue
where a default value is returned if the vertex isn't found. It could cut down on boiler plate code for callers if they always want a value, but I'm not sure how important this is right now.The text was updated successfully, but these errors were encountered: