When working on an application Module a developer should decide how it will be used by other modules. This is known as the Module's interface. It basically describes which module objects can be accessed by other modules.
A Module Interface is described by setting the value of the Object Visibility property of its objects.
- Public objects are part of the public interface, they can be accessed by any object of any module.
- Private objects are not part of any interface, they can only be accessed by objects in the same module (and its child objects).
- Internal objects can be accessed by objects that have the same root module (child of the one named 'Root Module')
An interface must be easy to use and to learn, and hard to misuse. It must be kept in mind that its main purpose is to expose a set of functionalities in order to satisfy a set of requirements. It is adviced to be thought to keep it easy to read, mantain and extend, the best way in doing so is keeping it simple.
- Use the Module Interface Tab to have a clearer vision of the interface.
- Keep it well documented, it is the 'face' of the Module, it should be easy to understand by anyone.
- Keep it simple, minimize changes. Keep in mind though that it will possibly change, therefore make changes as friendly as possible.
- Use decriptive names — for objects, methods, parameters, etc.
And consistently name them.
- The implementation details should not be exposed in the interface.