export ("M" Reference)
[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]
For a declaration to be referenced by other modules, the declaration must be explicitly exported using an export directive.
Syntax
exportidentifiers;
Identifiers is a list of one or more identifiers of declarations in this module that can be referenced from other modules.
Multiple export statements can occur inside a module.
Discussion
Modules may refer to exported declarations in other modules by using an import ("M" Reference) directive to name the module that contains the referenced declarations.
Within a module, any import directives must appear before any export directives, and any export directives must appear before any declarations.
Examples
For example, consider the following module.
module Contacts
{
export Person;
type Address
{
Street: Text;
City: Text;
}
type Person
{
FirstName : Text;
Age : Integer32;
}
}
The type Address
can only be referenced from within the module Contacts
. The type Person
can be referenced in any module that has an import
directive for module Contacts
, as shown in this example.
module Friends
{
import Contacts;
Friends : Person*;
}