BHoM / BHoM_Adapter

GNU Lesser General Public License v3.0
7 stars 5 forks source link

Allow push of multiple types at the same time #331

Closed alelom closed 1 year ago

alelom commented 1 year ago

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 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): image

Further, in order to allow a faster processing of this workflow, we can add things like:

FraserGreenroyd commented 1 year ago

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.