Using Modules to Scope the Model
[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.]
To create a model in Microsoft code name “M”, you must first define one or more modules. A module scopes the particular problem domain that you're modeling. Once you describe the domain in a module, you can load and use the module in other “M” modules.
Creating a Module
To define a module, use the module keyword. When you create a module, consider the domain that you want to model. For example, contact information could include different categories of data such as name, address, and phone information. The following “M” code creates a module named Contact
.
module Contact
{
}
When modeling a domain, you can use one module or several. Domains that have a broad scope are candidates for using multiple modules. For example, the contact information may specifically relate to customers. Instead of having one module named Customer
, you could create several modules that define different aspects of a customer. The contact information could reside in a module named Customer.Contact
. If you also model account information, this could reside in a module named Customer.Account
. These names do not enforce any relationship between the two modules, but they do make the overall model easier to understand and manage.
For more information about using modules, see Program Structure: Modules ("M" Programming Guide).