if (ChildA.Size > Root.MaximumChildSize) throw SomeException
One of the basic OOP principles to keep in mind is program to an interface and not an implementation. A child should not have a reference to its concrete parent. A child should know as little about its parent as possible. It is not a good idea for the child to have a reference to its parent because it becomes tightly-coupled with its parent. This creates a rigid design and does not make your child reusable. The most common way to solve your problem is to abstract out what your child needs into an interface or abstract class. The parent should implement this interface and the child should only reference the parent through this interface.
You could also have root monitor col1 for changes and throw the exception.
Copyright (c) Marimer LLC