---
title: SAIF.Services.Printing.Remote architecture
summary: Architectural responsibilities, boundaries, and interaction patterns.
status: draft
owner: <owner>
last_reviewed: 2026-07-24
library: SAIF.Services.Printing.Remote
reference_type: package
---

# SAIF.Services.Printing.Remote architecture

SAIF.Services.Printing.Remote is a BOF (Business Object Framework) class library that orchestrates deferred and batch print processing for Oracle-backed print-control data. It exposes three parallel families of business objects — print control batches, documents, and deferred print items — each following the standard SAIF BOF business-object/collection/Criteria pattern, and contains no application host or controller entry point of its own.

## Responsibilities
- Represent a print-control batch header (`clsXPrintControl`/`clsXPrintControlCollection`) covering directory, duplex mode, processed date, and an XML-file MD5 hash.
- Represent individual print jobs/documents (`clsXDocument`/`clsXDocumentCollection`) linked to a print-control batch via `XPrintControlSeqNum`, with bin/printer routing metadata and sort-value-driven sequencing.
- Represent deferred (queued) print requests (`clsXDeferredPrint`/`clsXDeferredPrintCollection`) retrievable by print date or document description for later batch processing.
- Provide data-access responsibilities for the above via `IBusinessCriteria`-based SQL against Oracle tables `XPRINT_CONTROL`, `XDOCUMENT`, `XDEFERRED_PRINT`, joined at read time to `XPRINTER_BIN` and `XPRINTER` for routing resolution.
- Enforce optimistic-concurrency/contention checks on every insert, update, and delete across all six business objects.

## Component boundaries
- **Print control** (`clsXPrintControl`, `clsXPrintControlCollection`): batch/run header representing a set of documents queued for print processing; each has a nested `Criteria` implementing `IBusinessCriteria`.
- **Document** (`clsXDocument`, `clsXDocumentCollection`): individual print jobs tied to a print-control batch, with bin-type/printer routing and print-sequencing metadata; collection drives batch/group printing logic via the `PrintType` enum (`ByDocSeq`, `ByPrintGroup`).
- **Deferred print** (`clsXDeferredPrint`, `clsXDeferredPrintCollection`): queued print requests retrievable by date (`byDate`) or document description (`byDocDescr`).
- **Institutions typed DataSet** (`Institutions.Designer.vb`): a generated bank/institution lookup data shape; no consuming code was found in this library's source files.*
- All six business objects inherit the framework base classes `clsBusinessBase`/`clsBusinessCollectionBase` supplied by the `SAIF.BOF.Framework`/`SAIF.BOF.Business` NuGet packages. No cached inherited framework context was available for these base classes at analysis time — their internal behavior beyond what is directly visible in this library's source is not documented here.**

## Interaction model
- Each business object/collection follows the standard BOF layered pattern: business object → nested `Criteria` (`IBusinessCriteria`) holding SQL text → `Before*`/`After*` lifecycle methods building an `IDataRequest` and consuming `IPortalRequest` results → `IDataPortalInfo.DataAccessLayer` executes the request.
- Collections follow a reader-iteration pattern: `AfterRetrieve` casts the result to `IDataReader`, loops `Reader.Read()`, and calls each child object's `Load()` method, which internally calls `Fill()` and constructs a `Criteria`.
- `clsXDocumentCollection.BeforeRetrieve` selects between two SQL shapes depending on `Criteria.PrintType`: `RetrieveSQL` (per-document, `ByDocSeq`) or the non-interface `RetrievePrintSQL` (grouped, `ByPrintGroup`).
- This library has no controller/service-host entry point — it is a pure class library consumed by other applications/services as a NuGet package (`SAIF.BOF.Services.Printing.Remote`).
- Several `Criteria` SQL properties contain live SQL text whose corresponding `Before*` lifecycle method is fully commented out (or, for `clsXDocumentCollection.DeleteSQL`, has no `BeforeDelete` override at all), meaning that SQL is not invoked by any code path in this library today (see [Dependencies](dependencies.md) for the affected statements).

The following diagram shows the high-level component interactions for the print-control/document/deferred-print families.

```mermaid
flowchart TD
	A[clsXPrintControl /<br>clsXPrintControlCollection] -->|XPrintControlSeqNum| B[clsXDocument /<br>clsXDocumentCollection]
	B -->|joins for routing| C[XPRINTER_BIN / XPRINTER]
	D[clsXDeferredPrint /<br>clsXDeferredPrintCollection] -->|Criteria SQL| E[(Oracle: XDEFERRED_PRINT)]
	A -->|Criteria SQL| F[(Oracle: XPRINT_CONTROL)]
	B -->|Criteria SQL| G[(Oracle: XDOCUMENT)]
	A --> H[IDataPortalInfo /<br>IDataRequest]
	B --> H
	D --> H
	H --> I[(Oracle Database)]
```

The following diagram shows the primary retrieve sequence for a print-control batch and its documents.

```mermaid
sequenceDiagram
	participant Caller
	participant XPrintControlCollection
	participant XDocumentCollection
	participant DataPortal as IDataPortalInfo
	participant Oracle
	Caller->>XPrintControlCollection: GetXprintControlCollection(processedDate)
	XPrintControlCollection->>DataPortal: BeforeRetrieve / RetrieveSQL
	DataPortal->>Oracle: SELECT ... FROM XPRINT_CONTROL
	Oracle-->>DataPortal: rows
	DataPortal-->>XPrintControlCollection: AfterRetrieve (IDataReader)
	Caller->>XDocumentCollection: Retrieve by XPrintControlSeqNum
	XDocumentCollection->>DataPortal: BeforeRetrieve / RetrieveSQL (join XPRINTER_BIN, XPRINTER)
	DataPortal->>Oracle: SELECT ... FROM XDOCUMENT JOIN XPRINTER_BIN JOIN XPRINTER
	Oracle-->>DataPortal: rows
	DataPortal-->>XDocumentCollection: AfterRetrieve (IDataReader)
	XDocumentCollection-->>Caller: populated document collection
```

## Design constraints
- Data access is confined entirely to the `IBusinessCriteria`/`IDataPortalInfo` abstraction; no direct `DbConnectionManager` or raw ADO.NET/Oracle connection code exists in this library.
- All six business objects depend on framework base classes (`clsBusinessBase`, `clsBusinessCollectionBase`) and the `IBusinessCriteria` interface supplied externally by `SAIF.BOF.Framework`/`SAIF.BOF.Business`; no inherited-framework context was available from the Legends CLI cache for this run, so base-class internals are not further described.**
- The library targets `.NET Framework 4.6.2` and is packaged/consumed exclusively as a NuGet package (`IncludeReferencedProjects=true`), not via local project references.
- Several referenced packages (`Autofac`, `FluentValidation`, `iTextSharp`, `RestSharp`, ASP.NET Web API packages — third-party — and `ImagingAPI.Client`, `PdfAPI.Client` — internal SAIF-organization NuGet packages) show no corresponding `Imports`/type usage in the reviewed source files — their live usage, if any, could not be confirmed.**
- `clsXPrintControl.DuplexMode`'s getter falls through with no `Return` for unrecognized duplex codes, an inferred undefined result rather than an explicit default.**

> **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
- [Index](index.md)
- [Overview](overview.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

## Sources
- `Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb`
- `Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb`
- `Services\SAIF.Services.Printing.Remote\clsXDocument.vb`
- `Services\SAIF.Services.Printing.Remote\clsXDocumentCollection.vb`
- `Services\SAIF.Services.Printing.Remote\clsXDeferredPrint.vb`
- `Services\SAIF.Services.Printing.Remote\clsXDeferredPrintCollection.vb`
- `Services\SAIF.Services.Printing.Remote\SAIF.BOF.Services.Printing.Remote.vbproj`
