ShiftLeftSecurity / overflowdb

ShiftLeft OverflowDB
Apache License 2.0
112 stars 21 forks source link

Improve BatchedUpdate.DiffGraphBuilder.addEdge API #290

Closed bbrehm closed 2 years ago

bbrehm commented 2 years ago

During porting of our giant collection of passes, I stumbled upon the problem that I naively assumed that the age (NewNode vs StoredNode) of src and dst nodes is always statically known. This is not true for many passes.

The old api functions are retained for binary compatibility. The new addEdge function takes Object and does runtime checks, because nobody needs union types, right?

Note that the scala API looked somewhat nicer, because there is a more sensible AbstractNode shared supertype of NewNode and StoredNode. Since these are not odb concepts, we cannot do this here.

mpollmeier commented 2 years ago

I don't really like Object here and would much prefer to move AbstractNode (or a similar new marker trait) into ODB. Currently the odb-codegen generates it, but in reality it's a static class anyway, in the sense that it doesn't depend on the schema at all. What do you think?

bbrehm commented 2 years ago

OK, will do.