Use
Generally users of a class may only access the public components of that class. Sometimes, however, you might want to create a closer link between classes. The concept of friends could be of use here.
In this case a class can permit explicitly named users (friends) to access its protected and private components.
Prerequisites
All the users declared to be friends (classes and interfaces) were already created.
Procedure
If you set the flag to Modeled only, no entry is made in the class pool. The friends relationship is only displayed and managed in the Class Builder. The friends relationship cannot be used at runtime.
Result
All the users specified as friends can also access
PROTECTED a nd PRIVATE components of the class in question if the Modeled only flag was not set in step 4. The friends relationship is always one-sided and is not inherited. This means that friends of a superclass are not automatically friends of the subclasses.