Model write pipeline¶
clsModelBase.Write() is a template method that guarantees WriteData() is only invoked when ValidateData() succeeds. Both methods are abstract (MustOverride) and implemented entirely by the concrete model in each consuming application — this library only enforces the ordering contract.
| Field | Value |
|---|---|
| Operation ID | OP-MVC-004 |
| Trigger | Explicit call to clsControllerBase.Write() (which calls Model.Write()), typically on a save postback |
| Inputs | Model's in-memory state, populated by the concrete Retrieve implementation |
| Outputs | Boolean success |
| Primary components | clsModelBase.Write, clsControllerBase.Write |
| Entry point | SAIF.Presentation.Web.MVC\clsModelBase.vb |
Steps¶
clsControllerBase.Write()callsModel.Write().clsModelBase.Write()calls the abstractValidateData()(BR-MVC-006).- If
ValidateData()returnsTrue: call the abstractWriteData()and return its result. - If
ValidateData()returnsFalse: returnFalsewithout callingWriteData(). - Both
ValidateData()andWriteData()are implemented by the concrete model in the consuming application — no further step tracing is possible from this library alone.
Process flow¶
flowchart TD
Start([controller.Write called]) --> ModelWrite[Model.Write]
ModelWrite --> Validate[ValidateData - concrete model]
Validate --> Valid{Returns True?}
Valid -->|Yes| WriteData[WriteData - concrete model]
Valid -->|No| Fail([Return False, no persistence])
WriteData --> Success([Return WriteData result])
Failure and edge-case behavior¶
- No default validation logic exists in this library; if a consuming model's
ValidateData()always returnsTrue, this pipeline provides no actual data-integrity protection on its own. - Exceptions thrown by
ValidateData()orWriteData()propagate up toViewPageBase.Page_Error→ Error handling.
Related documentation¶
Sources¶
- SAIF.Presentation.Web.MVC\clsModelBase.vb
- SAIF.Presentation.Web.MVC\clsControllerBase.vb