SAIF.Application architecture¶
SAIF.Application is an abstract application-manager library positioned between consuming applications or services and BOF business objects. Its architecture centers on manager base classes, keyed data-portal registration, cached authorization checks, and message/result helpers rather than direct business logic or SQL execution.
Responsibilities¶
- Standardize application-manager lifecycle hooks for initialization, context changes, validation, retrieval, writing, and transaction boundaries.
- Centralize application-level accessibility state through
AppSecurityRoleand theIsAccessible/IsUpdateable/IsViewOnly/IsRestrictedaccessors. - Provide keyed SQL Server and Oracle
IDataPortalInforegistration throughApplicationDataAccess. - Encapsulate reusable access-check caching through
UserAccess. - Support service-hosted manager implementations through
clsServiceAppManagerBase,ServiceMessage, andServiceResponse.
Component boundaries¶
AppManagerBase: Abstract base for classic application managers; owns lifecycle hooks, role-state accessors, message accumulation, and access toApplicationDataAccess.ApplicationDataAccess: Data-portal factory and registry; createsIDataPortalInfoinstances but does not issue SQL statements directly.UserAccess: Standalone authorization helper that delegates resource checks toclsSecurityPrincipaland caches results per resource name.MessageFormatting: Static helper for turning message collections into display strings.clsServiceAppManagerBase: Service-oriented base type for managers that operate with a single injectedIDataPortalInfoinstead of a keyed portal library.ServiceMessage/ServiceResponse: Result-object pattern for service consumers that need categorized response messages.
Interaction model¶
- Consuming code initializes an
AppManagerBaseimplementation, which delegates setup work to override hooks such asOnInitialize()andOnCreateDataLayer(). - The manager uses
ApplicationDataAccessto register one or more SQL Server or Oracle portals keyed for later retrieval. - Security evaluation flows through subclass logic that assigns a single application role and can call
UserAccess.HasAccess(...)when resource-based checks are needed. - Classic managers expose accumulated message text directly, while service-based managers package outcomes through
ServiceResponseandServiceMessage.
Architecture diagram¶
The following diagram shows the high-level component interactions in the library.
flowchart TD
Consumer[Consuming application or service] --> AppManager[AppManagerBase]
Consumer --> ServiceManager[clsServiceAppManagerBase]
AppManager --> DataAccess[ApplicationDataAccess]
AppManager --> Access[UserAccess]
DataAccess --> Portal[IDataPortalInfo]
ServiceManager --> Portal
Access --> Principal[clsSecurityPrincipal]
Portal --> BusinessObjects[BOF business objects]
Sequence diagram¶
The following diagram shows a typical application-manager sequence.
sequenceDiagram
participant Consumer
participant Manager as AppManagerBase
participant Data as ApplicationDataAccess
participant Access as UserAccess
participant Principal as clsSecurityPrincipal
Consumer->>Manager: Initialize()
Manager->>Data: CreateSQLServerPortal(...) / CreateOraclePortal(...)
Data-->>Manager: IDataPortalInfo registered
Consumer->>Manager: OnCheckSecurity()
Manager->>Access: HasAccess(resourceName)
Access->>Principal: IsAuthorized(resourceName)
Principal-->>Access: Boolean result
Access-->>Manager: Cached access result
Manager-->>Consumer: Retrieve() / Write() enabled by role
Design constraints¶
- The library defines contracts and supporting infrastructure; consuming applications implement the concrete lifecycle behavior through override hooks.
ApplicationDataAccessmanages connectivity abstractions only; actual SQL and table interactions live in downstream business-object libraries.- Role gating is intentionally centralized to a single effective
AppSecurityRole, aligning the class behavior described by BR-001. - Message aggregation behavior follows the duplicate-suppression rule documented in BR-002.
- Authorization reuse relies on the per-resource cache documented in BR-003.
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- API reference
- Configuration
Sources¶
Application\SAIF.Application\AppManagerBase.vbApplication\SAIF.Application\ApplicationDataAccess.vbApplication\SAIF.Application\MessageFormatting.vbApplication\SAIF.Application\UserAccess.vbApplication\SAIF.Application\Service Based\clsServiceAppManagerBase.vbApplication\SAIF.Application\Service Based\ServiceMessage.vbApplication\SAIF.Application\Service Based\ServiceResponse.vbApplication\SAIF.Application\SAIF.BOF.Application.vbproj