I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering. Of course, as mentioned above, that tends to not be very practical when we're modeling things at the level of a "Universe" with the types of shifting requirements imposed on game engines which often want to model a "Universe" of sorts (however simplified, gamedevs are creating their own miniature universe, and I'd dare say that is one of the most challenging things to do from a programming design standpoint as they are literally trying to be "gods" breathing life into some universe whether it's Super Mario or Unreal 4).
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering. Of course, as mentioned above, that tends to not be very practical when we're modeling things at the level of a "Universe" with the types of shifting requirements imposed on game engines which often want to model a "Universe" of sorts (however simplified, gamedevs are creating their own miniature universe, and I'd dare say that is one of the most challenging things to do from a programming design standpoint).
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering. Of course, as mentioned above, that tends to not be very practical when we're modeling things at the level of a "Universe" with the types of shifting requirements imposed on game engines which often want to model a "Universe" of sorts (however simplified, gamedevs are creating their own miniature universe, and I'd dare say that is one of the most challenging things to do from a programming design standpoint as they are literally trying to be "gods" breathing life into some universe whether it's Super Mario or Unreal 4).
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering. Of course, as mentioned above, that tends to not be very practical when we're modeling things at the level of a "Universe" with the types of shifting requirements imposed on game engines which often want to model a "Universe" of sorts (however simplified, gamedevs are creating their own miniature universe, and I'd dare say that is one of the most challenging things to do from a programming design standpoint).
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering.
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering. Of course, as mentioned above, that tends to not be very practical when we're modeling things at the level of a "Universe" with the types of shifting requirements imposed on game engines which often want to model a "Universe" of sorts (however simplified, gamedevs are creating their own miniature universe, and I'd dare say that is one of the most challenging things to do from a programming design standpoint).
Just write accessor-methods for all accessor-methods of all classes that Master is composed of. This leads to perfect encapsulation, because no implementation detail of Master is visible [...]
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering.
Just write accessor-methods for all accessor-methods of all classes that Master is composed of. This leads to perfect encapsulation, because no implementation detail of Master is visible [...]
I don't consider that "perfect encapsulation". That might be a bit subjective but what I consider the strongest level of encapsulation is a class whose state doesn't even need to be exposed in the first place (through accessor functions or anything else). In my mind it's a class that exposes the absolutely minimal information about itself, like a container that doesn't even need to expose what's stored inside for anything other than read-only access. That is the strongest way to maintain invariants over its state is to not expose it in any mutable form whatsoever. If we want to maintain Universe-level invariants in our Universe class/interface, then we cannot expose anything inside of it for tampering.