🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
User-Paid-Model-Snippet
This page was created by Hans.karlsen on 2021-03-31. Last edited by Wikiadmin on 2026-07-29.

You can commission a reusable MDriven Designer model snippet when you need a defined piece of model functionality and want to merge and evolve it in your own model.

What the service delivers

A model snippet is a selected, reusable part of a model. Depending on the requested pattern, it can contain model classes, associations, ViewModels, actions, and related configuration.

For example, you may need a repeatable pattern that creates a ViewModel for all instances of a class together with create and delete actions. Rather than rebuilding and checking that pattern in each model, you can request it as a snippet and apply it with a replacement value for the target class name.

After delivery, you merge or apply the snippet to your model and own the continued modeling work. You can inspect, change, extend, or remove the merged model elements.

When to use a user-paid model snippet

Use this service when all of the following are true:

  • You can describe the required behavior as model functionality.
  • The work can be delivered as a model part that you can integrate into your model.
  • You want to maintain and evolve the result yourself after delivery.

Typical requests include a reusable model pattern, a ViewModel pattern with actions, or a self-contained model section that adds a defined capability.

Do not use this service to request a change to the MDriven Framework itself. A framework feature follows the user-paid extension process: the feature becomes part of the framework, is not exclusive to the financer, and is delivered in a MDriven release. Describe the required outcome and ask MDriven for an estimate for the appropriate type of work.

Request a fixed-price estimate

Give MDriven a written description of the snippet you need. Include images or sketches when they clarify the expected user interface or behavior.

Describe the request in terms that can be checked after delivery:

Include What to state Example
Purpose The user or business outcome "An administrator must be able to view and manage all instances of a selected class."
Model scope The classes, associations, packages, ViewModels, and actions involved, if known "The pattern applies to Vehicle and needs a ViewModel plus create and delete actions."
Expected behavior What happens when the user opens, changes, creates, or deletes something "The list view creates a new Vehicle and allows the selected Vehicle to be deleted."
Configuration points Names or values that must be replaceable when the snippet is applied "The target class name must be replaceable so the same snippet can be used for Vehicle or Customer."
Acceptance examples Concrete cases that demonstrate the requested result "Applying the snippet for Customer creates the corresponding ViewModel and actions, with Customer replacing the placeholder throughout."

MDriven assesses the request and provides a fixed-price estimate for the requested model snippet. If you accept the estimate and pay the agreed fee, MDriven creates the model part and makes it available to you. MCoins can be used to pay for MDriven services; confirm the payment arrangement as part of the estimate.

Delivery and catalog sharing

After the work is complete, you receive the model snippet or mergeable model section for integration with your current model.

If the delivered functionality is generic enough, MDriven may also add it to its catalog of downloadable model snippets. Catalog availability does not prevent you from changing the copy that you merged into your own model.

Integrate the delivered work

Review the delivered elements before treating them as part of your application model. Keep the new model elements in a clearly named package if that makes their origin and purpose easier to understand.

Apply a Designer snippet

Use this approach when the delivery is a snippet intended for the MDriven Designer snippet mechanism.

  1. Import the delivered snippet into MDriven Designer.
  2. Select the model location where you want to apply it, such as a package or a ViewModel.
  3. Open the snippet and select Apply.
  4. Enter values for any replacements. A replacement is a text placeholder that lets one snippet be adapted to a specific model element, such as replacing Test1 with Customer.
  5. Apply the snippet.
  6. Inspect the created classes, ViewModels, actions, and references. Verify that placeholders were replaced where expected.
  7. Run and test the affected application behavior, then save the model.

A snippet must explicitly include every kind of element it is intended to create. For example, a ViewModel can refer to actions, but the actions are only created when they are included in the snippet as actions. If an expected action is missing after applying a snippet, review the snippet contents before applying it again.

Merge a delivered model section

Use this approach when the delivery is a complete mergeable model rather than an imported Designer snippet.

  1. Download the delivered model file.
  2. In MDriven Designer, select File/Open Merge.
  3. Select the downloaded model file.
  4. Review the classes, views, and actions that were added to your model.
  5. Resolve any model-specific adjustments required by the delivered pattern, then test the resulting application.

A mergeable model can contain complete model parts, including classes, views, and actions. For the general merge procedure, see Merge models.

Keep the snippet maintainable

Once integrated, the delivered model elements are part of your model. Treat them as you would other model code:

  • Read the classes, associations, ViewModels, and actions before extending them.
  • Rename or organize elements to match your model conventions where this does not break required references.
  • Test the requested acceptance examples after each adjustment.
  • Keep a copy of the delivered artifact so you can compare later changes with the original pattern.

Related downloadable patterns

Before commissioning new work, review model examples and downloadable model patterns. An existing mergeable model or snippet may already cover part of your requirement. For an example of a model extension that supports charging an application end user, see Charge end user.

See also