SAIF.Framework.Version operations and processes¶
SAIF.Framework.Version exposes four operations on its Version value object: parsing a version string, formatting a version back to a string, comparing two versions numerically, and incrementing a version from a caller-supplied template. Every operation is implemented directly on the Version class — there are no external dependencies, no delegated logic, and no database interaction anywhere in this library. This page is the operation catalog and cross-operation hub; each operation's detailed, step-by-step logic lives in its own page under operations/.
Operation catalog¶
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
|---|---|---|---|---|---|---|---|
| Parse version input | Convert a dot-delimited string into a four-segment Version instance |
Caller constructs New Version(input) or invokes Version.Parse(input) |
input As String |
New Version instance |
BR-002 | — | — |
| Format version string | Render the current version as its canonical four-part string | Caller invokes Version.ToString() |
Current Major, Minor, Build, Revision values |
Major.Minor.Build.Revision string |
— | — | — |
| Compare versions numerically | Determine equality or ordering from each segment's numeric value, not its literal text | Caller invokes CompareTo or operators =, <>, <, > |
Two Version instances, or obj As Object for CompareTo |
Boolean comparison result or integer CompareTo result |
BR-001, BR-006, BR-007 | — | — |
| Increment version from template | Advance the version in place using a template that mixes wildcard, retention, literal, and date tokens | Caller invokes Version.Increment(format) |
format As String, current segment values |
Updated Version instance (Me) |
BR-001, BR-003, BR-004, BR-005 | — | — |
Process flow diagram¶
The following diagram visualizes how a caller reaches each of the four operations and what each returns.
flowchart TD
Start([Caller request]) --> Choice{Requested operation}
Choice -->|Parse a string| Parse[Parse version input]
Choice -->|Render to text| Format[Format version string]
Choice -->|Compare two versions| Compare[Compare versions numerically]
Choice -->|Advance a version| Increment[Increment version from template]
Parse --> Parsed([Return new Version instance])
Format --> Formatted([Return version string])
Compare --> Compared([Return comparison result])
Increment --> Updated([Return updated Version instance, mutated in place])
Failure and edge-case behavior¶
Version.Parse(input)andVersion.Increment(format)perform no null check of their own; passingNothingforinputorformatlets the underlyingString.Splitfailure propagate to the caller as an unhandled runtime exception.- Parsing defaults only the trailing segments —
Minor,Build, andRevision— to"0"when they are absent (BR-002); any segments beyond the fourth are silently discarded, and a blankMajortoken is preserved as-is rather than defaulted. ToString()performs no normalization: whatever text is currently stored in each segment — including blank or non-numeric values — is emitted verbatim.- Every comparison first normalizes each segment through
ToInt, so a segment that is non-numeric or fails conversion is treated as0rather than raising an error (BR-001, BR-006). - The
<and>operators contain a tautologicalv2.Major.ToInt = v2.Major.ToIntguard ahead of the minor-segment comparison; it always evaluatesTrueand is a likely copy-paste defect that does not currently distort comparison results (BR-007). Increment(format)copies literal segment text through unvalidated; only the wildcard path routes the prior segment value throughToIntnormalization before incrementing it (BR-001, BR-003, BR-004, BR-005).
Related documentation¶
Sources¶
SAIF.Framework.Version\Version.vb