One of the important benefits of System Modeler is the ability to encapsulate data. The visibility property supports encapsulation—where the internal workings of a class are hidden from external objects. This prevents your data from being freely updated.
You can shield the attributes of a class by giving them private visibility, so that they can only be updated by a public method of their class. This allows you to apply rules that are enforced whenever the attributes are used, without having to code the rules in the logic of any object that attempts to access them.
The members of a class, such as attributes, methods, and other classes (Refer to Recognizing the Model Elements), have a visibility property that defines where in the model they can be seen from. The levels of visibility are:
Private – the object can only be seen from within its owning class.
Protected – the object can be seen from within its owning class and its subclasses.
Public – the object can be seen from outside its owning class.
In general, if you create a class as a member of another class, it becomes an inner class. For example, when you create an Ispec class within a segment class, the ispec is an inner class. This allows it to see the members of its owning class. However, if you change the inner class’s IsInnerClass property to false, it is no longer an inner class and cannot see the members of its owning class, even though it is a member of another class.