Softview lets you patch a deployed ViewModel without uploading a new model or restarting MDriven Turnkey or MDrivenServer; use it when you need to correct or adjust a view while keeping the running application available.
What Softview does
A Softview is a replacement ViewModel file that the running server loads from disk when that ViewModel is requested. It separates a targeted view change from a full model deployment.
For example, you can correct a column label, adjust a layout position, add a placing container, or correct a missing sort order in a ViewModel. Users receive the changed view when they make a new request for that ViewModel; no server restart is required.
Softview is available in both MDriven Turnkey and MDrivenServer. When either server detects a new uploaded model, it expands the complete model into files under:
App_Data/ModlrLeanComplete
The expanded folder contains the ViewModels from the deployed model. A ViewModel is represented by a .span file.
How runtime reload works
Softview uses the modification time of a ViewModel file to detect a replacement.
- A user requests a ViewModel.
- The server checks the corresponding
.spanfile inApp_Data/ModlrLeanComplete. - If the file is newer than the version last read by the server, the server reads the file again.
- Turnkey checks whether its Razor page has a newer ViewModel version and recompiles the HTML used to deliver the view.
- The user receives the updated view on the next request, such as when refreshing or reopening the view.
The reload is per ViewModel and on demand. Updating a file does not force every connected user to reload a view immediately.
Patch a ViewModel
Prepare the replacement in MDriven Designer's ViewModel Editor rather than editing the deployed file by hand. This gives you a reviewable ViewModel change and reduces the risk of invalid file content.
- Identify the ViewModel to change and make the change in MDriven Designer.
- Save or export the ViewModel in the expanded-model format so that you have the ViewModel's
.spanfile. - On the target server, open
App_Data/ModlrLeanComplete. - Locate the deployed
.spanfile for the ViewModel. - Preserve the currently deployed file so that you can restore it if the patch must be reverted.
- Copy the replacement
.spanfile intoApp_Data/ModlrLeanComplete, replacing the file with the same name. - Request the ViewModel again. For a Turnkey user interface, refresh or reopen the view.
- Verify the intended behavior in the running application.
For example, if a date field currently displays an unsuitable presentation label, update that label in the ViewModel, deploy the replacement .span file, and refresh the view. Turnkey detects the newer file and renders the updated label.
Use Softview for focused changes
Softview is intended for view-level corrections that need to be available sooner than the next full model release.
| Suitable Softview changes | Example |
|---|---|
| Presentation and layout adjustments | Correct a field label or move a field that overlaps another control. |
| Responsive layout adjustments | Add a placing container so that a view behaves better when the available width is limited. |
| View configuration corrections | Correct a missing sort order in a combo box. |
| ViewModel behavior updates | Replace the ViewModel file with an updated version when the required change is contained in that ViewModel. |
Treat a Softview as a controlled patch, not as a substitute for normal model deployment. Keep the replacement ViewModel associated with the model version it was made for, test it before deployment, and plan to include the correction in a later full model release.
Revert a patch
If a replacement view causes an issue, restore the earlier .span file with the same name. On the next request for that ViewModel, the server detects the restored file as a newer disk version and reloads it.
A restart is not required for the revert. Confirm the result by requesting the affected view again.
Limits and important rules
Only ViewModel .span files in App_Data/ModlrLeanComplete are read from this folder at runtime.
| Item | Runtime effect |
|---|---|
Replace a ViewModel .span file
|
The server can reload that ViewModel when it is next requested. |
Change another file in App_Data/ModlrLeanComplete
|
No effect on the running application. |
Change the deployed .span file directly
|
It may be detected and loaded, but editing generated XML directly is not the recommended authoring workflow. Make and validate the change in MDriven Designer, then copy the resulting file. |
Do not expect changes to diagrams, assets, or other model files in App_Data/ModlrLeanComplete to alter the application. Softview reads ViewModel files only.
Softview and ModlrLeanLoad
ModlrLeanLoad and Softview work together during startup and runtime.
ModlrLeanLoad stores a reduced model to improve startup time and memory use. Its reduced model does not contain ViewModel content. Instead, ViewModel content is loaded according to the Softview strategy when a ViewModel is actually requested.
This also means the server does not need to keep every ViewModel fully loaded in memory from startup. In a system with many ViewModels, only the views requested by users need to be loaded.
Operational checklist
Before copying a Softview patch to a production server, confirm all of the following:
- The replacement is a
.spanfile for the intended ViewModel. - The file name matches the deployed ViewModel file you intend to replace.
- The patch was prepared and checked in MDriven Designer.
- You have retained the prior
.spanfile for rollback. - You have a way to request and verify the affected view after deployment.
- You understand that a later full model upload can replace the expanded-model content and therefore supersede the patch.
