SAIF.Framework.CodeGen architecture¶
SAIF.Framework.CodeGen is a narrow, single-purpose developer/code-generation tooling library. It reads Oracle "code table" reference data and emits VB.NET source-code text fragments (Case statements or Enum member lists) for a developer to paste into hand-written code. It does not participate in runtime business-object lifecycle, web request handling, or application-layer orchestration, and it bypasses the standard BOF business-object pattern by connecting directly to the Oracle data layer.
Responsibilities¶
- Generate VB
Casestatement blocks from a code table's rows, for manual insertion into hand-written source code (CreateCaseStatement). - Generate VB
Enummember lists from a code table's rows (CreateEnumStatement). - Establish and, when parameters change, re-establish a direct Oracle data-layer connection used solely to source code-table data for generation (
Connect). - Derive unique, legal VB identifier names from code-table row values (
GetEnumValue).
Component boundaries¶
CodeTableMap(public class): the sole public entry point of the library. Owns the connection lifecycle, SQL execution, and source-text generation. It is a standalone tooling class, not aclsBusinessBase/clsBusinessCollectionBasebusiness object.CodeBlockType(public enum): valuesCaseStatement,EnumStatement. Defined for external callers but not referenced by any live code in this library; its intended consumer is unknown*.- Oracle data layer boundary:
CodeTableMapdirectly instantiatesclsMSOracleDataLayer(fromSAIF.Business) and obtains anIDataPortalInfo, then issues a raw SQL query throughSqlHelper.ResultSetQuery(fromsaif.framework). This is the library's only external system boundary. - No presentation, web, or WCF surface exists in this library.
Interaction model¶
- A caller constructs
CodeTableMap(dbUser, database), which invokesConnectto establishm_dpi(the Oracle data-portal handle). - The caller then invokes
CreateCaseStatementorCreateEnumStatement, supplying a table name, enum name, and generation options. - Each of these public methods calls the private
GetResult(table)helper, which buildsselect code, code_descr from {table}viaString.Formatand executes it throughSqlHelper.ResultSetQuery(m_dpi).Execute(sql), returning aclsResultSet. - For each returned row,
GetEnumValuederives a unique, legal VB identifier from thecode/code_descrcolumns. - The method accumulates and returns a generated source-text string; no output is written to disk or persisted — the caller is responsible for consuming the returned text.
- No callers of
CodeTableMapwere found anywhere in this repository. This library appears to be invoked interactively/manually (e.g., from a console or test harness) rather than as part of any runtime request pipeline**.
The following diagram shows the high-level component interactions between the caller, CodeTableMap, and the Oracle data layer.
flowchart TD
A[Caller / developer tool] --> B[CodeTableMap]
B --> C[clsMSOracleDataLayer<br>SAIF.Business]
B --> D[SqlHelper.ResultSetQuery<br>saif.framework]
D --> E[(Oracle code table)]
B --> A
The following diagram shows the primary sequence for generating a source-code fragment from a code table.
sequenceDiagram
participant Caller
participant CodeTableMap
participant DataLayer as clsMSOracleDataLayer / IDataPortalInfo
participant Oracle as Oracle code table
Caller->>CodeTableMap: New CodeTableMap(dbUser, database)
CodeTableMap->>DataLayer: Connect (establish m_dpi)
Caller->>CodeTableMap: CreateCaseStatement / CreateEnumStatement
CodeTableMap->>DataLayer: GetResult(table)
DataLayer->>Oracle: select code, code_descr from table
Oracle-->>DataLayer: rows
DataLayer-->>CodeTableMap: clsResultSet
CodeTableMap-->>Caller: generated VB source text
Design constraints¶
- Bypasses the standard BOF
clsBusinessBase/clsBusinessCollectionBase+IBusinessCriteriapattern entirely;CodeTableMaphas no nestedCriteriaclass and exposes noCreateSQL/RetrieveSQL/InsertSQL/UpdateSQL/DeleteSQLproperties. - Table name is passed as a caller-supplied string and interpolated directly into SQL text via
String.Format, not as a bound parameter; there is no fixed table literal anywhere in the source. - Only a read (
SELECT) operation is performed; the library has no write/insert/update/delete capability. - Connection re-establishment is optimized:
Connectonly reconstructsclsMSOracleDataLayerwhendbUserordatabasediffer from the current connection. - Targets
.NET Framework v3.5, consistent with the surrounding legacy BOF codebase. - No configuration-file-driven settings, security/authorization checks, or AD integration exist in this library; connection parameters are supplied entirely as constructor arguments.
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Configuration
- Database tables
- SQL catalog
- 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.Framework.CodeGen\CodeTableMap.vb
- SAIF.Framework.CodeGen\SAIF.Framework.CodeGen.vbproj