I was wondering if it was at all possible to construct a family of classes which know each other's secrets but have secrets for the outside world.
Some classes could share a common interface, allowing them to call each other and be nested in arbitrary ways, but keep this interface private so that the rest of the codebase can't possibly depend on / mess with it.
Is that a thing?
The only way I can think of to make it work is to actually have only one class with some branching inside, and I don't like this idea one bit. To my knowledge, there is no way to achieve this effect via inheritance.