Skip to content

Use a node factory to minimize the codebase #1

@thnaeff

Description

@thnaeff

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, ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions