Context validity check¶
ValidContext is the single, always-current boolean gate that consuming code checks before invoking a manager's Retrieve() or Write() methods. Unlike the security-role flags, it is fully delegated to the subclass — AppManagerBase supplies no default implementation at all.
| Field | Value |
|---|---|
| Operation ID | OP-APP-03 |
| Trigger | Calling code reads the ValidContext read-only property |
| Inputs | Current manager instance state (subclass-defined) |
| Outputs | Boolean context-validity result |
| Primary components | AppManagerBase.ValidContext, AppManagerBase.OnValidContext (MustOverride) |
| Entry point | Application\SAIF.Application\AppManagerBase.vb |
Steps¶
- Caller reads
ValidContext. Any code holding a reference to anAppManagerBase-derived instance can read the public read-onlyValidContextproperty at any time; there is no precondition on when it can be called. - Delegate to the subclass hook. The property getter's entire implementation is
Return OnValidContext()— it performs no computation of its own and simply forwards to the abstractOnValidContext()method. - Subclass evaluates its own readiness. The concrete application-manager subclass implements
OnValidContext()to inspect whatever state it considers necessary — for example, whether a required identifier has been populated, whetherRetrieve()has already succeeded, or whetherMarkContextSet()has been called.* - Because this logic lives entirely in the consuming application, this library's documentation cannot enumerate the specific validity criteria; they are out of scope for
SAIF.Applicationitself. - Caller acts on the result. Consuming code typically gates a subsequent
Retrieve()orWrite()call onValidContextreturningTrue, butAppManagerBasedoes not enforce this gating — it is a convention the caller must follow. - If the caller proceeds despite
ValidContextreturningFalse: behavior is entirely subclass-defined and unguarded at theAppManagerBaselevel.*
Process flow¶
The following diagram visualizes the delegation from the base-class property to the subclass hook.
flowchart TD
Start([Caller reads ValidContext]) --> Delegate[AppManagerBase.ValidContext<br>calls OnValidContext]
Delegate --> SubclassCheck[Subclass OnValidContext<br>inspects its own state]
SubclassCheck --> Result{Result}
Result -->|True| Proceed([Caller proceeds with<br>Retrieve or Write])
Result -->|False| Halt([Caller should not proceed;<br>not enforced by AppManagerBase])
Failure and edge-case behavior¶
AppManagerBaseprovides zero default validity logic; a subclass that fails to implementOnValidContext()meaningfully (for example, always returningTrue) defeats the check entirely with no warning from the base class.*- Nothing ties
ValidContextto theContextSetflag tracked viaMarkContextSet()/MarkContextNotSet()— see Application context initialization — so the two signals can disagree if the subclass does not keep them consistent.* - Because the property has no side effects, repeated reads are safe and always reflect current subclass state at the time of the call — there is no caching of the result.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Related documentation¶
Sources¶
Application\SAIF.Application\AppManagerBase.vb