SAIF.Framework.Connection architecture¶
SAIF.Framework.Connection is a thin, single-purpose connection-string resolution helper built around a single public class, clsConnection. It does not open, execute, or manage database commands itself; it only builds or resolves a ConnectionString value on a caller-supplied OracleConnection or SqlConnection object, delegating the actual string resolution to a remote ConnectInfo SOAP web service (with a local, Oracle-only override path when explicit credentials are supplied at construction).
Responsibilities¶
- Resolve Oracle connection strings by populating the
ConnectionStringproperty of a caller-suppliedOracleConnectionobject, viagetConnection(inInstance, inCode, inUserid, ByRef inCnObj As OracleConnection, ...). - Resolve SQL Server connection strings by populating the
ConnectionStringproperty of a caller-suppliedSqlConnectionobject, viagetConnection(inServer, inCode, inDatabase, ByRef inCnObj As SqlConnection). - Delegate connection-string resolution to the remote
ConnectInfoASMX/SOAP web service for both Oracle and SQL Server, except when explicit Oracle credentials are supplied at construction. - Provide a local, Oracle-only override path that bypasses the web service when the caller constructs
clsConnectionwith explicit user/password credentials (New(inOracleUser, inOraclePassword)). - Apply post-processing to web-service-resolved Oracle connection strings: strip the literal
Load Balance Timeout=900;clause and replace theZSPECIALCHARtoken with the BEL control character (Chr(7)).*
Component boundaries¶
clsConnection(SAIF.Framework.Connectionnamespace): the sole public entry point. Owns constructor-based override state (m_ConnectStringOverride) and bothgetConnectionoverloads. Contains no SQL execution, no business-object base-class inheritance (clsBusinessBase/clsBusinessCollectionBase), and no direct database I/O.ConnectInfo.ConnectInfo(auto-generated SOAP client proxy,SAIF.Framework.Connection.ConnectInfonamespace): inheritsSoapHttpClientProtocol; exposesGetOracleConnectString,GetDB2ConnectString, andGetSQLConnectString(sync and async overloads). OnlyGetOracleConnectStringandGetSQLConnectStringare invoked byclsConnection;GetDB2ConnectStringis present but unused within this library.*ConnectInfo.ConnectRequestInfo(auto-generated DTO): carriesOSUserid,Code,Database, andServervalues as the request composite passed to the SOAP proxy.- Remote
ConnectInfoASMX web service (external boundary, not part of this library): the authoritative source of Oracle and SQL Server connection strings, hosted athttp://saifonline/WebServices/wsDBConnections/ConnectInfo.asmx. - Caller (any consumer of this library): supplies instance/server/database/code identifiers plus a
ByRefOracleConnectionorSqlConnectionobject, and is solely responsible for opening, using, and disposing that connection aftergetConnectionreturns.
Interaction model¶
- The caller instantiates
clsConnection, optionally supplying explicit Oracle credentials to the parameterized constructor, which setsm_ConnectStringOverride = True. - The caller invokes the Oracle or SQL Server overload of
getConnection, passing identifying parameters and aByRefconnection object. - For the Oracle overload: if the override flag is set,
clsConnectionbuilds the connection string locally from the stored credentials; otherwise it instantiates theConnectInfoSOAP proxy, builds aConnectRequestInfo(Code, Database, currentSystem.Environment.UserNameasOSUserid), callsGetOracleConnectString, replacesZSPECIALCHARwithChr(7), and stripsLoad Balance Timeout=900;from the result.* - For the SQL Server overload:
clsConnectionalways builds aConnectRequestInfo(Code, Database, Server, OSUserid) and callsGetSQLConnectStringvia the SOAP proxy; there is no local override path for SQL Server. - The resolved connection string is assigned to the caller's connection object's
ConnectionStringproperty;clsConnectionreturns control to the caller, which is responsible for opening/using/disposing the connection. - The
ConnectInfoSOAP proxy's endpoint URL is read once, at proxy construction, from an auto-generatedApplicationSettingsBase(My.Settings) value (SAIF_Framework_Connection_ConnectInfo_ConnectInfo), declared inapp.config.
The following diagram shows high-level component interactions.
flowchart TD
Caller["Caller<br>(business/application code)"] --> ClsConnection["clsConnection<br>(getConnection overloads)"]
ClsConnection -->|"override path<br>(Oracle only)*"| LocalBuild["Local connection-string<br>builder"]
ClsConnection -->|"non-override path"| Proxy["ConnectInfo SOAP proxy<br>(SoapHttpClientProtocol)"]
Proxy --> WebService["Remote ConnectInfo<br>ASMX web service"]
LocalBuild --> Result["OracleConnection /<br>SqlConnection.ConnectionString"]
Proxy --> Result
Result --> Caller
Sequence diagram¶
The following diagram shows the primary request/response sequence for the non-override (web-service-resolved) path.
sequenceDiagram
participant Caller
participant clsConnection
participant ConnectInfoProxy as ConnectInfo proxy
participant ConnectInfoService as Remote ConnectInfo service
Caller->>clsConnection: getConnection(instance/server, code, database, ByRef cnObj)
clsConnection->>ConnectInfoProxy: New ConnectRequestInfo(Code, Database, OSUserid[, Server])
ConnectInfoProxy->>ConnectInfoService: GetOracleConnectString / GetSQLConnectString
ConnectInfoService-->>ConnectInfoProxy: connection string
ConnectInfoProxy-->>clsConnection: connection string
clsConnection->>clsConnection: replace ZSPECIALCHAR with Chr(7) and strip "Load Balance Timeout=900" (Oracle only)*
clsConnection-->>Caller: cnObj.ConnectionString populated
Design constraints¶
- No
IBusinessCriteria,clsBusinessBase, orclsBusinessCollectionBaseinheritance — this is a low-level infrastructure/utility class, not a business object. - No direct SQL execution:
clsConnectionnever callsOpen(),ExecuteReader, orExecuteNonQuery; opening and using the connection is entirely the caller's responsibility. - The non-override path introduces a runtime dependency on a network call to an external SOAP web service (
ConnectInfo.asmx), not merely a design-time reference.* - The local override path is Oracle-only; no equivalent override exists for SQL Server, which always depends on the remote web service.
- The Oracle connection-string post-processing (stripping
Load Balance Timeout=900;and substitutingZSPECIALCHARwithChr(7)) is undocumented in code comments; its business rationale is inferred from behavior only.* - The library has no authentication, authorization, or security-check logic; the only identity-related data point is the outbound use of
System.Environment.UserNameas an audit/context parameter (Composite.OSUserid), not an authorization check. - A large commented-out
<system.serviceModel>block inapp.configdefines a self-hosted WCF service configuration (wcfDBConnections.ConnectInfo) that is inactive and excluded from these findings.
Related documentation¶
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.Connection\clsConnection.vbSAIF.Framework.Connection\Web References\ConnectInfo\Reference.vbSAIF.Framework.Connection\Web References\ConnectInfo\Reference.mapSAIF.Framework.Connection\Web References\ConnectInfo\ConnectInfo.wsdlSAIF.Framework.Connection\app.configSAIF.Framework.Connection\SAIF.BOF.Framework.Connection.vbproj