SAIF.Business.Utilities architecture¶
SAIF.Business.Utilities is a leaf, stateless text-formatting utility library. Despite its SAIF.Business.* name, it contains no business entities, BOF business objects, persistence, or service calls — it exists solely to normalize legacy uppercase-stored text into display-ready casing and to render numbers as English words.
Responsibilities¶
- Convert free-form name/address/description text (typically all-caps legacy data) into display-ready title case while preserving original delimiter characters, via
TitleCase.ToTitleCaseand its extension-method façadeTitleCaseExtensions.ToTitleCase. - Provide supporting casing helpers:
ToProperCase,ToPadCapitalLetters,ToLower,ToUpper,ContainsOnlyNumericCharacters. - Render whole numbers as English words via
mdlTextConversion.NumberToText(e.g. for written amounts on legal/printed output*). - Normalize a string to sentence casing via
mdlTextConversion.ToSentenceCase.
Component boundaries¶
TitleCase(class) +TitleCaseExtensions(module): a rules-driven casing engine and its extension-method surface. All members areShared; word lists are immutablePrivate Sharedarrays, so the component holds no instance state*.mdlTextConversion(module): number-to-words conversion and sentence casing, independent of theTitleCasecomponent — the two components have no coupling between them.- Both components are
Public Module/Shared-only, so importing theSAIF.Business.Utilitiesnamespace silently addsToTitleCase,ToProperCase,ToPadCapitalLetters,ToLower,ToUpper,ContainsOnlyNumericCharacters, andToSentenceCaseextension methods toString/String()across the consuming project — a wide ambient surface that is a notable coupling characteristic*.
Interaction model¶
- The library has no outbound in-repo project references — it is a leaf/foundation library depending only on the BCL,
Microsoft.VisualBasic, and the sharedSAIF.Framework.Commonextension/format helpers (ToStringAll,IsIn,TakeFromEnd,PadCapitalLettersFormat)*. - Within this repository it is consumed only by
SAIF.Business.View.Policy, which calls.ToTitleCaseonPolicyNameandPolicyStatusDescriptioninclsPolicyAssociation.vb, confirming this library sits below the view/presentation-model layer as a formatting service*. - Calls are synchronous, in-process method/extension-method invocations with no persistence or external service interaction.
Architecture diagram¶
The following diagram shows the two independent components and their only in-repo consumer.
flowchart TD
A[SAIF.Business.View.Policy<br>clsPolicyAssociation] --> B[TitleCaseExtensions.ToTitleCase]
B --> C[TitleCase.ToTitleCase]
C --> D[SAIF.Framework.Common<br>PadCapitalLettersFormat, extensions]
E[mdlTextConversion<br>NumberToText / ToSentenceCase]
Sequence diagram¶
The following diagram shows the primary request/response sequence for title-casing a display value.
sequenceDiagram
participant Caller as clsPolicyAssociation
participant Ext as TitleCaseExtensions
participant Core as TitleCase
Caller->>Ext: PolicyName.ToTitleCase()
Ext->>Core: ToTitleCase(inString)
Core-->>Ext: title-cased string
Ext-->>Caller: title-cased string
Design constraints¶
- Statelessness: all members are
Shared/module-level with immutable word lists, so calls are side-effect free and thread-safe*. - Recursion depth in
TitleCase.ReassembleStringscales with word count, and inmdlTextConversion.NumberToTextscales with numeric magnitude*. - No
Try/CatchguardsTitleCase.ToTitleCase; a source string whose delimiter positions do not align with the reassembly index can surface an index-out-of-range exception**. - The nested
Tests/Tests.vbproj(MbUnit) documents the expected casing contract but is not listed inLegalMaintenance.sln, so it is not built or run by the repository build*.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
SAIF.Business.Utilities/TitleCase.vbSAIF.Business.Utilities/TitleCaseExtensions.vbSAIF.Business.Utilities/mdlTextConversion.vbSAIF.Business.Utilities/SAIF.Business.Utilities.vbproj