It certainly smells bad at many levels. Just ask yourself what will happen if someone continues the Child; or another subclass of Parent is created (instead of Child).
It is hard to imagine a case that would justify this design (perhaps it exists, you could explain what you are trying to achieve). (Are you familiar with the factory pattern?)
In any case, in order to get reasonable behavior for such a design, I think that you need to accept and accept the connection, even try to ensure its observance by making the childβs class final / sealed (impossible to extend) and considering both classes as all. But then again, this could (almost certainly) be better achieved with another clean design.
source share