Kemsekov / GraphSharp

GraphSharp is a tool to study and use knowledge of graph theory in C#!
MIT License
39 stars 5 forks source link

Design issue with `INode.Edges` and it's implementations #36

Closed Kemsekov closed 2 years ago

Kemsekov commented 2 years ago

Problem

INode.Edges must be read-only. You cannot add or delete Edges from casted to down-level INode. Currently your INode.Edges is IList which allows to add and remove nodes.

Solution

Create your own ImmutableCollection for list that also allows casting from inherited to base classes.

Kemsekov commented 2 years ago

I am done with it. Now code is a lot more bloated with generic things but it works faster and in general easier to maintain and extend.