Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we support data structure deeper than List<List<T>> ? #381

Open
adecler opened this issue Mar 18, 2021 · 1 comment
Open

Should we support data structure deeper than List<List<T>> ? #381

adecler opened this issue Mar 18, 2021 · 1 comment
Assignees
Labels
type:question Ask for further details or start conversation

Comments

@adecler
Copy link
Member

adecler commented Mar 18, 2021

Right now we have a single method in the BHoM that return a data structure of depth 3 (i.e. List<List<List<>>>):

System.Collections.Generic.List`1[System.Collections.Generic.List`1[System.Collections.Generic.List`1[BH.oM.Dimensional.IElement1D]]] DistributeOutlines(System.Collections.Generic.List`1[System.Collections.Generic.List`1[BH.oM.Dimensional.IElement1D]], Boolean, Double)

There are no methods that take inputs deeper than level 2.

It feels to me that any method that requires inputs/outputs deeper than level 2 is a red-flag for refactoring. In a way this is no different than a Grasshopper script that requires complex data tree structures to work. As always, I can be wrong as I don't know the context of this method.

So my question is: should we refactor DistributeOutlines or should be provide support for deep data structures in the UI ?

@adecler adecler added the type:question Ask for further details or start conversation label Mar 18, 2021
@FraserGreenroyd
Copy link
Contributor

FraserGreenroyd commented Mar 27, 2021

I want to say no. I don't have a very good reason right at this moment in time but no feels like the right choice. It's a gut feeling.

Nested lists can get complex quite quickly, List<List<T>> provides enough use for 99.99999% of the methods based on your analysis @adecler so I would be tempted to go with us resolving the outlier, as that is evidence to suggest that by default, no one developing for the BHoM over the years has ever desired to do deeper levels of list nesting.

As such, I'm inclined to agree that we should not support structures deeper than 2 levels as we currently do, and the aforementioned offending method should be refactored.

That's my feeling on it, but I also do not have knowledge of that particular method to provide a clear answer for why it was done, so happy to have my mind changed with more information 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Ask for further details or start conversation
Projects
None yet
Development

No branches or pull requests

6 participants