You can use MDrivenStart in MDriven Designer to choose the next modeling task, validate your model, run it locally, and prepare it for deployment.
Contents
Use MDrivenStart as your modeling checklist
MDrivenStart helps you move from an information model to an application that you can run and inspect. Select the task that matches the change you need to make, then return to MDrivenStart to continue with the next task.
A typical workflow is:
- Define the information your application must store.
- Define how users view and work with that information.
- Validate the model and correct all errors.
- Run the model locally in the Prototyper.
- Deploy the finished system when it is ready for production.
For example, for an application that tracks customers and their orders, you might create the classes Customer and Order, add a relationship between them, define a view for entering orders, and add an action for creating an order.
Choose what to do next
| If you need to... | Use this task | Example |
|---|---|---|
| Add or change a type of information | Define classes | Create a Customer class to represent each customer.
|
| Add a single value to an existing class | Define attributes | Add a Name attribute to Customer.
|
| Relate objects of two classes | Define associations | Relate a customer to the orders that belong to that customer. |
| Add reusable behavior or a calculation | Define methods | Add a query method that calculates a value without changing data. |
| Change how information is presented | Define views | Create a view that shows a customer's details and related orders. |
| Give a user something to do in the application | Define user actions | Add an action that opens the view used to create an order. |
| Add a prepared set of model functionality | Merge models | Merge a downloaded model snippet that contains classes, views, and actions. |
Define the information model
An information model describes the classes of objects your application manages and how those objects relate to each other.
Classes
A class represents a kind of object. For example, Customer represents customers and Order represents orders. Use Define classes to create or change a class, assign its package, document its purpose, and set its default string representation.
The default string representation is what the user interface can display when it needs to show an object without being told which attribute to use. For a Customer, it can typically be an expression based on a string attribute such as the customer's name.
Attributes
An attribute stores one simple value on an object. Use Define attributes for values such as a customer name, an order date, or an amount. State the attribute's simple type.
An attribute can be nullable. This means that no value has been assigned; for an integer, no value is different from 0. Use an association, rather than an attribute, when the information is a list of related objects.
Associations
An association describes how classes relate. Use Define associations when a Customer has orders, or an Order belongs to a customer. Associations model the connection between objects; attributes model individual simple values.
Methods
A method defines behavior on a class. Use Define methods when the model needs a calculation or an operation.
A method with IsQuery=true has an OCL body and must not change data. A method with IsQuery=false can use action language to change data. Methods can accept arguments. For example:
MyMethod(argument1:String;argument2:Double):String
Define the application experience
After the information model describes what you store, define how people work with it.
Views
A view defines a perspective on information. For example, you can define a customer view that shows the customer's name together with the related orders. Create or change views when users need to browse, edit, or inspect information in a particular context.
User actions
User actions define what users can initiate. Use Define user actions to choose the action scope:
| Action type | Where users find it | Example |
|---|---|---|
| Global action | The main menu | Open a ViewModel that starts a customer-management workflow. |
| Class action | The left-side menu when an object of the class is available | Start an action for the selected customer. |
| ViewModel action | One specific view | Perform an action available only while working in an order-entry view. |
A ViewModel is the model used for a user interface. Use a global action when the user should begin from the main menu; use a class action when the action applies to an object of a particular class; use a ViewModel action when it only makes sense in one view.
Validate before you run
Before running or deploying the application, use Verify to ensure that the model is coherent and has no errors. Validation also runs automatically whenever you save the model, but you can run it manually when you want to check your current work.
Correct every validation error before continuing. For example, two classes with the same name make the model invalid. A clean model is required before you start the Prototyper or deploy to a server.
Run locally in the Prototyper
Use Prototyper to execute the model locally and see the application in your browser. The local mini-server is MDrivenTurnkeyCore. It stores the information created by your application in a simple file; production data is stored in a database.
- Download the mini-server when you first need it, or download it again when you want a newer server version.
- Start the Prototyper.
- Allow the application to open in your default browser.
- Close the Prototyper start window and keep the browser open while you work.
- Change and save the model; the running application updates automatically.
Running the application is the practical way to identify missing views, actions, or model behavior. For example, if you can create a customer but cannot create an order from the customer workflow, return to the model and define the required view or user action.
Add prepared functionality by merging
Use Merge models when you want to add a complete model snippet that can contain classes, views, and actions.
- Download the model you want to add.
- In MDriven Designer, select
File/Open Merge. - Select the downloaded model and merge it into your current model.
- Run Verify before you continue to the Prototyper.
Continue to deployment
When the model validates cleanly and behaves as intended in the Prototyper, continue to deploy the system to the cloud. Deployment publishes the system for use beyond your local machine.
