SAIF.Business.Utilities architecture¶
SAIF.Business.Utilities is a narrow, stateless, leaf-level text-formatting utility library. It has no BOF business-object lifecycle, no persistence, and no UI involvement; its entire public surface converts raw stored text (typically all-caps names, addresses, or statuses) into human-readable mixed case, and converts numeric amounts into English word form.
Responsibilities¶
- Convert all-caps or inconsistently cased stored strings into human-readable "title case" via
TitleCase.ToTitleCaseand the.ToTitleCase()string extension. - Provide additional string-shaping extension helpers (
.ToProperCase(),.ToPadCapitalLetters(),.ToLower()/.ToUpper()for string arrays,.ContainsOnlyNumericCharacters()). - Spell out numeric (
Long) values as English words viamdlTextConversion.NumberToText, for amount-in-words style rendering. - Provide a simple sentence-case transform via
.ToSentenceCase().
Component boundaries¶
TitleCase(Public Class, all membersShared): owns the title-casing algorithm — tokenization, per-token case classification against curated word lists, delimiter-preserving reassembly, and possessive-suffix handling.TitleCaseExtensions(Public Module): exposesTitleCase.ToTitleCaseand related string helpers as.ToXxx()extension methods callable directly onString/String()instances; a thin surface adapter, not an independent responsibility.mdlTextConversion(Public Module): owns numeric-to-English-words conversion (NumberToText) and the unrelatedToSentenceCaseextension.- No component in this library performs data access, participates in
IDataPortalInfo/ProcessPortalRequestflows, or holds mutable instance state — every public entry point is aShared/Module-level pure function operating only on its string/numeric input.
Interaction model¶
- The library has zero outbound project dependencies of its own (no
<ProjectReference>entries inSAIF.Business.Utilities.vbproj); all dependency flow is inbound (fan-in), consistent with a shared, foundation-level utility package. - It is consumed by higher business-layer libraries — confirmed call sites in
SAIF.Business.Policy.Agency\clsAgency.vb(Nameproperty) andSAIF.Business.View.Policy\Associations\clsPolicyAssociation.vb(PolicyName,PolicyStatusDescriptionproperties) — which call.ToTitleCase()to format display-name values sourced from Oracle-backed business data. SAIF.Application.Policy\PolicyHeader\clsStandardPolicyHeaderDataProvider.vbholds a project/assembly reference to this library, but no direct call site toToTitleCase/ToSentenceCase/NumberToTextwas confirmed in that file; the exact member used there is unconfirmed.**- Internally,
ToTitleCasefollows a tokenize → classify → reassemble → suffix-correction → first-letter-force pipeline: it splits input on non-word/non-digit boundaries viaRegex.Split, title-cases each token against static word lists, reassembles tokens with original delimiters preserved via a recursiveReassembleStringhelper, re-applies an exact-suffix pass for possessive'shandling, then forces the first output character to upper case. NumberToTextfollows a magnitude-based recursive decomposition (ones/teens → tens → hundreds → thousands/millions/billions/trillions), each level delegating to the privateRoundDownhelper for integer floor-division.
Design constraints¶
- Title-casing exception vocabulary (all-caps abbreviations, mixed-case exceptions, connector words, name prefixes/suffixes, ordinal suffixes) is governed entirely by static, hard-coded
Sharedword lists rather than external configuration or database lookup — extending the vocabulary requires a code change and rebuild, not a config change.* NumberToTextenforces an upper bound of 999,999,999,999,999 and throwsApplicationExceptionbeyond that value.- The great majority of packages declared in
SAIF.Business.Utilities.vbproj(the SAIF BOF Framework set,SAIF.Framework.Common,SAIF.HashUtil,SAIF.Web.API.Clients/Core,Oracle.ManagedDataAccess,Newtonsoft.Json,RestSharp) are unused by this library's two-file source surface and appear to be inherited from a shared project template rather than reflecting real functional dependencies.* OnlySystem.Text/System.Text.RegularExpressions(BCL) are demonstrably exercised by the code. - No SAIF BOF Framework base-class inheritance is present (frameworkDensity = 0); this library does not participate in the BOF data-portal lifecycle.
Architecture diagram¶
The following diagram shows this library's leaf position and its fan-in consumers.
flowchart TD
A[SAIF.Business.Policy.Agency<br>clsAgency] --> U[SAIF.Business.Utilities]
B[SAIF.Business.View.Policy<br>clsPolicyAssociation] --> U
C[SAIF.Application.Policy<br>clsStandardPolicyHeaderDataProvider] --> U
U --> T[TitleCase /<br>TitleCaseExtensions]
U --> M[mdlTextConversion]
Sequence diagram¶
The following diagram shows a typical title-casing call from a consumer property.
sequenceDiagram
participant Consumer as clsAgency.Name
participant Ext as TitleCaseExtensions
participant TC as TitleCase
Consumer->>Ext: m_AgencyName.ToTitleCase()
Ext->>TC: ToTitleCase(inString)
TC->>TC: Regex.Split into tokens
TC->>TC: TitleCaseSingleWord per token
TC->>TC: ReassembleString with original delimiters
TC->>TC: ApplyExactSuffixList
TC-->>Ext: title-cased string
Ext-->>Consumer: formatted display name
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Configuration settings
- API reference
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.
Sources¶
- SAIF.Business.Utilities\SAIF.Business.Utilities.vbproj
- SAIF.Business.Utilities\TitleCase.vb
- SAIF.Business.Utilities\mdlTextConversion.vb
- SAIF.Business.Policy.Agency\clsAgency.vb
- SAIF.Business.View.Policy\Associations\clsPolicyAssociation.vb
- SAIF.Application.Policy\PolicyHeader\clsStandardPolicyHeaderDataProvider.vb
- .saifdocgen/state/runs/20260821-113120-claims-bof-web-legal/analysis/TSK007-analysis.md