Transfer from Ben Wassermann: Extended composite interface
Transferred issue: mbauerm6f/simopenpass#5
Right now the composite interface only allows to add new child nodes at the end of the child list, but inserting, replacing or deleting is not possible. There are some use cases like synchronizing the tree, e.g. with a GUI (which allows to manipulate the tree), where the add child method alone is not enough. Of course, it is possible to synchronize by recreating the corresponding subtree, but I would like to discuss here whether an extension of the interface would not be useful anyway.
Therefore I would suggest to provide appropriate methods for inserting, replacing and deleting. Instead of just delete and replace, more sophisticated variants could be provided like cutOut and swap, which allows to keep the old nodes.