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

Adjust existing grid API to move ValueAccessor methods to the tree #1789

Conversation

danrbailey
Copy link
Contributor

This change moves the ValueAccessors down into the Tree class instead of creating them in the Grid. Although we don't take advantage of this in the core library, this offers greater flexibility in allowing custom Tree implementations to define their own ValueAccessors rather than having to use the standard one.

@Idclip
Copy link
Contributor

Idclip commented Apr 13, 2024

Whilst this looks good and the justification for the change makes sense, are we still trying to avoid introducing new methods to the tree? For example, wouldn't the advertised way of creating accessors not simply be ValueAccessor<T> acc(tree) or typename TreeT::Accessor acc(tree);

@danrbailey
Copy link
Contributor Author

Whilst this looks good and the justification for the change makes sense, are we still trying to avoid introducing new methods to the tree? For example, wouldn't the advertised way of creating accessors not simply be ValueAccessor<T> acc(tree) or typename TreeT::Accessor acc(tree);

Yes and it's a fair question. In the broad sense, the methods that I think we should primarily target are those that recurse throughout the full tree hierarchy and that add significant cost to readability, parsing or instantiation. I don't think these convenience methods that live only on the tree are nearly as problematic when considered under that criteria and the trade-off is that creating accessors from a tree becomes much more unintuitive with these new methods I feel.

@danrbailey danrbailey merged commit 1f9a882 into AcademySoftwareFoundation:master Sep 18, 2024
41 checks passed
@danrbailey danrbailey deleted the move_value_accessors_to_tree branch September 18, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants