3.2.1. Introduction
A model is in effect a collection of types. A model also introduces a namespace. Contexts and roles introduce namespaces, too:
-
a context gives its name to the roles and actions defined in it;
-
a role gives its name to the properties and views defined in it.
A context can also contain other contexts (notice we’re talking types here!) and so provides a namespace to them. This might lead us to think that a model is just another context. And it is. However, a model is a context without a context. In other words, it is the root of a namespace hierarchy. We call such a context a Domain. So a Domain is a context that contains all other types in the model, recursively.
However, a DomeinFile – derived from a Model’s source text – is not just a context. To start with, it is represented differently. In Perspectives, it plays the role of a package. All types (contexts, roles, properties, views, actions) are pulled up to the surface and are available in maps as members of a record. The PDR uses this representation to quickly look up any type.
Furthermore, Instances can be packaged with a DomeinFile, indeed, an instance of model:System$Model must be packaged with it. The external role of this context instance has properties that give its readable name and description, and the url where it resides (a repository on the open internet).
Last, but not least, a DomeinFile/Package lists the other DomeinFiles/Packages it’s definitions depend on, in the sense that they refer to types defined in them.
To sum up:
-
a Model is a collection of types;
-
a Domain is the root context of a Model, having no context itself;
-
a DomeinFile is a Package, the physical transport format of the represented types constituting the model.