A picture paints a thousand words.
This section gives an overview of the MTT to put the overall process into context. The figure below shows the key components:
The MTT can be run either:
Projects are where the key inputs and outputs for the MTT are held. These are:
The exported Information Model. The UML, or other, definition of the information types and relationships that is to be used as the requirements for the generation process. The library.xml file in the figure below.
The mtt-config file. Which defines project-specific configuration information that is required for the MTT to run. For example: which loader to use, which generators are applicable to this project, any inter-project dependencies, etc.
The config folder. Any project-specific loader or generator configuration. If many projects use common configuration files then these can be defined once and referenced from many projects mtt-config files.
The generated folder. Where the generated files are written. Each projects mtt-config can define a different folder structure if needed. The MTT will create the folder structure as specified in the mtt-config file so does not need to be created manually.
Other files and folders. The files and folders discussed above are either required or generated. However, other files and folders can be stored in the same repository. As shown below, the Sparx EA published html filles are stored in the model folder Library model and the generated markdown files are run through the MkDocs tool to generate a complete model documentation website Library documentation
This file structure and file contents are the same whether the project is hosted on GitHub or locally.
Local projects can be stored anywhere on a file system but it is recommended that a simple structure, similar to GitHub, is used with a repo-base folder and all MTT projects located under that. Unlike with GitHub repositories, maintaining version control through Git or similar, is a manual process and not managed by the MTT
MTT has a tight integration with projects stored in GitHub repositories and will manage retrieving the input files and storing and committing and output back to GitHub. Consequently, to run the MTT on a GitHub project requires the user to have a GitHub account and for the MTT to be registered as a GitHub application by the user/organisation. MTT can also be invoked directly from GitHub, using Actions, as part of a CD/CI workflow.
This section describes the various steps in selecting a project, running the chosen generators and viewing the results of the generation process.
The MTT Home page consists of two sections, Projects and Learn as shown in the figure and described below.
As described, Projects can be stored in either GitHub or Local repositories. Clicking on either of the 'Select Project' buttons will go to a page that has a drop-down of available MTT projects and a set of checkboxes to allow selection of the generators to be run. As shown in the figure below.
Currently just this page, though this will be expanded to provide training on developing models suitable for use in generating valid and complete outputs.
Running one or more generators, over an information-model, to produce output files is the fundamental purpose of the MTT.
There are a number of Generators currently available with the MTT but, as described below, tailoring or developing new generators is often needed for a particular application.
As described in MTT Overview, a core design principle of the MTT Internal Model is to make adding new Generators, flexible, quick and easy.
However, creating a new Generator does require some key information to be available as described and illustrated below. The figure aims to bring out two key points, using the OpenAPI and Reversed standards as examples:
There are four example projects that illustrate various aspects of the information models that input to the MTT process and the generated outputs. Both the information models and the generated outputs can be viewed on the Example Projects page:
Library. This project covers most of the information modelling techniques that are relevant to MTT generators, including: Relationships (of various types, including Composition and Reflexive), Specialization (Inheritance), Association-Classes and the use of Stereotypes and Tags. As the name suggests, the subject-matter is about Borrowers (Adult and Junior), Books, Loans, Librarians, etc.
Property Ownership. This project covers similar information modelling techniques as the Library project but is about Actors (People), Properties, Banks, Accounts and the relationships between them. The additional aspect this model illustrates is how to deal with relationships that are time limited. For example, period of ownership of a property.
Personal Details. A simple representation of a Person type, the relationships between Persons and common other types such as Address. It is intended to be used by some other projects, such as Library, as a model dependency.
Core Types. This project defines basic types, such as Integer, Float, String, etc. But it also has slightly higher-level types such as URL, URI, UUID, etc. It is intended to be used by most other projects as a model dependency.