Microsoft.Uml2
[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.]
With the Microsoft.Uml2 domain, you can load or examine UML across huge amounts of data to examine inheritance, dependencies, and other constructs by using SQL Server 2008 or Microsoft code name “Quadrant”. The Microsoft.Uml2 domain targets the Object Management Group’s Unified Modeling Language (UML) specification version 2.1.1; it is installed as the Microsoft.Uml2 SQL schema in a SQL Server Modeling Services database. The Unified Modeling Language (UML) is a language and notation system used to specify, construct, visualize, and document the models of software systems. You can import UML 2.1.1 model instances in an .xmi file that conforms to the L3 Merged CMOF specification into a Modeling Services database by using the UML loader (LoadUml.exe
) that is included with the SQL Server Modeling CTP. For more information, see LoadUml.exe Command Line Reference.
Microsoft.Uml2 Overview
The Microsoft.Uml2 domain has been significantly extended in this release. The UML model has been redefined based on the UML 2.1.1 L3 (Level 3) CMOF model, which is available on the OMG Web site. The Loaduml.exe import utility and the Exportuml.exe export utility can load and export .xmi files that contain the full breadth of L3-compliant content. This release also contains a preview of a Microsoft code name “Quadrant” UML Browser. With the “Quadrant” UML Browser, you can view a model of the content of classes within a package and analyze dependencies across classes.
Warning
In this release, the “M” language does not support update. As a result the views in the API are not updateable. In this release, Loaduml.exe is the only supported way to add UML content to Modeling Services; applications should not update the UML extents/tables directly. The “Quadrant” UML browser and the default “Quadrant” experience with the UML model does not allow editing.
The UML Domain Model
The OMG UML model is a complex model that uses type inheritance extensively. The resulting database necessarily reflects the complexity of this model. In terms of database design, the UML model is treated as a conceptual model that is mapped to a logical design expressed in “M”, which is in turn translated to the SQL physical design by the “M” compiler.
The UML model is based on the UML metaclass Element: UML models comprise collections of inter-related elements of different kinds. The inheritance hierarchy in the OMG UML model is represented in the UML domain as a “M” schema that contains extents and functions. In this domain, the extents define storage and the functions define the query API over this storage.
The storage part of the “M” schema uses a small number of patterns for expressing inheritance hierarchies in a relational database. The main data partitioning patterns, in “M” terms, are based on using an extent-per-class, an extent-per-hierarchy, or extent-per-concrete-class pattern. The pattern used for each part of the model is determined by an assessment of the likely data volumes and query profile for that part of the model. The initial storage design included in this release is likely to change as we gain experience using the database with a variety of UML models in different scenarios. For this reason no dependency should be taken on the storage design, which is considered to be a private part of the implementation; the extents are not exported from the Microsoft.Uml2 “M” module in which they are defined, for example.
By contrast the query API reflects the conceptual model and hides the implementation patterns; this API layer should only need to change if and when the OMG UML model itself changes. The API surfaces UML concepts by using “M” functions (views in SQL Server 2008). The following query returns all classes that are in a StockTrader
package:
Classes where value.Package.Name == “Stock Trader”
The following function retrieves all the operations for a specific class:
GetOperationsForClass(id : Integer64)
{
Operations where value.Class == id
}
The Classes View (Microsoft.Uml2 Schema) that is referenced in the query hides the fact that the data for a class in the storage design is partitioned across the ClassExtent Extent (Microsoft.Uml2 Module) and the ClassifierExtent Extent (Microsoft.Uml2 Module).
Loading UML Models into Modeling Services from .xmi Files
Notes on Using LoadUml.exe
Loaduml.exe loads UML data into a target folder in the Modeling Services database. The database is specified as a command-line option, and the folder is identified by a path expression of the form folder1/folder2
. The folder can exist at that path location but must not already contain UML content. If the folder does not exist it will be created along with any required parent folders.
Because files cannot be loaded into a folder that already contains UML content, you must load all interrelated .xmi files in a single load command. For example, if you export a model that contains multiple packages from a tool by using a separate file for each package, all package files should be loaded together; if a model has applied one or more profiles, the .xmi files that containins the profiles are loaded at the same time as the model files.
Loaduml.exe can also be invoked from “Quadrant” with some limitations. For more information about , see How to: Load an .xmi File By Using "Quadrant".
Loaduml.exe only loads model data; the Modeling Services database does not hold UML diagram layout information. At this point there is no standard for exchanging this information between UML tools.
Loaduml.exe processes .xmi files that contain UML content that is formatted as described by the OMG UML 2.1.1 specification. Some UML tools only support earlier versions of UML, so exported .xmi files from these tools will likely not be compatible with Loaduml.exe. Some UML tools create, and in some cases require, proprietary extensions within the .xml files that they import and export. Loaduml.exe does not load (and Exportuml.exe does not export) these non-standard extensions. Any problems encountered interoperating with third-party tools that can be traced to their use of earlier UML versions, non-standard XMI, or proprietary extensions are not to be considered a fault with the UML domain.
Exporting UML Models from Modeling Services into .xmi Files
UML models can be exported from the repository as .xmi files that can be processed by UML 2.1-compliant tools, including numerous third-party diagramming tools. You can execute Exportuml.exe only from a command prompt. Export operates on a single folder and will create a set of .xmi files equivalent to those originally loaded. The files should be semantically equivalent but will not be identical—the sequence of items may be different, for example.
Notes on Using Exportuml.exe
The UML Domain model does not support UML diagram information so Exportuml.exe exports UML model data only. To open an exported model in a UML diagramming tool, you will typically need to import the XMI file explicitly into the tool. To visualize the information by using UML diagrams, you must manually create the appropriate diagrams.
Exportuml.exe creates .xmi files that contain UML content that is formatted as described in the OMG UML 2.1.1 specification. UML tools that only support earlier versions of UML or XMI will not be able to open files created by Exportuml.exe. Some UML tools use and require proprietary extensions within the XMI they import and export to support certain features. Exportuml.exe will not export (and Loaduml.exe will not load) these non-standard extensions. Any features in UML tools that rely on proprietary extensions may not function correctly. Any problems encountered interoperating with third party tools that can be traced to their use of earlier UML versions, non-standard XMI, or proprietary extensions will not be considered a fault with the UML Domain.