I\'m facing a design issue in my program. I have to manage Nodes object which are part of a root ChainDescriptor.
Basically it looks like the following:
The usual implementation would be for each node to have strong reference to its child (i.e. keeps them alive), and each child to have a weak reference back to the parent.
The reason for this is to avoid circular references. If only strong references were used, then you'd have a situation where the parent refcount never drops to zero (because the child has a reference), and the child refcount never drops to zero (because the parent has a reference).
I think your ChainDescriptor
class is okay to use strong references here though.