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

Use a node factory to minimize the codebase #1

Open
thnaeff opened this issue Nov 27, 2023 · 0 comments
Open

Use a node factory to minimize the codebase #1

thnaeff opened this issue Nov 27, 2023 · 0 comments

Comments

@thnaeff
Copy link
Owner

thnaeff commented Nov 27, 2023

Potential idea: A node factory might be an approach to limit the codebase. For example, the on/off implementation could just be a standard implementation but the nodes are supplied by a factory with the on/off functionality in it. The same might apply to any of the other node implementations (list, set, with and without keys, ...).

The CollectionTreeNodeInterface already contains a nodeFactory method. Maybe a user-supplied factory could get executed in that method to create the node.

The tree would then probably have to have a generic type (which CollectionTreeNodeInterface already has).

The project would then mainly provide all the complex tree operations (iteration in various forms, printing, merging, adding and removal of nodes, copy of nodes and trees/branches, ...).

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

No branches or pull requests

1 participant