Show TOC

 Exposing Objects at Package InterfacesLocate this document in the navigation structure

When an object is exposed at the package interfaces of its clients, the number of potential clients increases significantly. Often, this is not wanted at all, in which case the object should be usable in a limited way.

Different usage types can be specified for direct use of the object and use after propagation. For use after propagation, only the usage types allowed for direct use or a subset thereof may be specified.

An interface can be marked as propagatable as a whole. By this, all objects it contains at any given time can be propagated by simply referring to the interface. An interface can only be marked as propagatable as a whole if all its containing objects allow the same set of usage types for direct use and for use after propagation. Also, whenever new objects are added to an interface that is marked as propagatable as a whole, the new objects must allow the same set of usage types for direct use and for use after propagation.

When the object is usable also after propagation, the number of potential clients of the object increases, and thus the probability increases that changes to the object will invalidate clients. To safeguard compatibility guarantees given by interfaces propagating the object, mechanisms may be introduced that lock those objects against certain changes.

This exactly applies to the object's propagation to an interface of the superpackage, that is, there won't be exceptions in this case.