As discussed with @IsakNaslundBh, @enricoantolini, and others, an useful workflow that we could support for the BHoM adapters -- in particular structural adapters -- is to allow the push of different types at the same time, dependencies included. This would be particularly helpful for models converted via the Karamba3D_Toolkit.
Currently the dependencyTypes logic falls within the FullCRUD method, which means that dependencies are handled on a per-type basis. Therefore, objects of certain types like BarLoads and Bars need a 2-step process, where Bars are pushed first, their AdapterId is assigned, and then they can be used to define BarLoads.
This can be improved by moving the dependency handling logic outside of the FullCRUD, before it gets called. We can collect and order the objects prior to them being sent to the FullCRUD based on the DependencyTypes (diagram credit @IsakNaslundBh):
Further, in order to allow a faster processing of this workflow, we can add things like:
caching objects that have been pushed, then matching them with object dependants by hash or other means (adding the exception of AdpterID fragment)
I think environments will like this @alelom - most of their adapters override the push to obtain the ability to push multiple types at once so centralising that would be nice.
Description:
As discussed with @IsakNaslundBh, @enricoantolini, and others, an useful workflow that we could support for the BHoM adapters -- in particular structural adapters -- is to allow the push of different types at the same time, dependencies included. This would be particularly helpful for models converted via the Karamba3D_Toolkit.
Currently the dependencyTypes logic falls within the
FullCRUD
method, which means that dependencies are handled on a per-type basis. Therefore, objects of certain types likeBarLoads
andBars
need a 2-step process, where Bars are pushed first, their AdapterId is assigned, and then they can be used to define BarLoads.This can be improved by moving the dependency handling logic outside of the FullCRUD, before it gets called. We can collect and order the objects prior to them being sent to the FullCRUD based on the DependencyTypes (diagram credit @IsakNaslundBh):
Further, in order to allow a faster processing of this workflow, we can add things like: