---
title: SAIF.Application.LogView architecture
summary: Architectural responsibilities, boundaries, and interaction patterns.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Application.LogView
reference_type: package
---

# SAIF.Application.LogView architecture

SAIF.Application.LogView is a self-contained BOF logging library built around two business-object pairs: one pair for application errors and one pair for application info or audit records. Its architecture centers on BOF factory and retrieve lifecycles, inline SQL criteria objects, collection queries that pair a capped row-set query with a count query for paging, and a small enum surface declared at namespace scope.

## Responsibilities
- Persist application error events to `App_Error`.
- Persist application info or audit events to `App_Info`.
- Expose collection retrieval paths that assemble SQL filtering and ordering dynamically.
- Translate caller-supplied free-text search strings into SQL Server full-text predicates.

## Component boundaries
- `clsAppError` and `clsAppError.Criteria`: single-row BOF object and single-object criteria type for `App_Error` inserts, retrieval, and deleted-flag updates.
- `clsAppErrorCollection` and `clsAppErrorCollection.Criteria`: collection object and collection criteria type for filtered `App_Error` searches.
- `clsAppInfo` and `clsAppInfo.Criteria`: single-row BOF object and single-object criteria type for `App_Info` inserts and retrieval.
- `clsAppInfoCollection` and `clsAppInfoCollection.Criteria`: collection object and collection criteria type for filtered `App_Info` searches, including a built-in `EPAY` and `DirectDeposit` exclusion.
- `TIMEUNITS`, `COMPARISONS`, and `STATISTICFIELDS`: standalone public enums declared in `clsResources.vb`.
- `SearchTypes`: standalone public enum declared in `clsAppInfoCollection.vb` for `App_Info` search targeting.
- `modLogViewExtensions`: non-public helper module that supplies the string helpers used by search parsing.

## Interaction model
- Callers create new log entries by invoking `CreateNewAppError(...)` or `CreateNewAppInfo(...)`, which populate BOF objects and execute `InsertSQL` during the save lifecycle.
- After each insert, the library executes `Select @@IDENTITY` to populate `AppErrorSeqNum` or `AppInfoSeqNum` on the saved object.
- Collection retrievals execute two queries per request: a `TOP 300` row query and a matching `COUNT(*)` query for total-row reporting.
- Search criteria objects add predicates only for populated filters, translate semicolon-delimited filters into `IN (...)` clauses, and normalize `SearchText` into `CONTAINS(...)` expressions.

## Architecture diagram
The following diagram shows the high-level interactions between callers, BOF business objects, and the two SQL Server tables used by the library.

```mermaid
flowchart TD
    A[Calling application or framework logger] --> B[clsAppError / clsAppInfo]
    A --> C[clsAppErrorCollection / clsAppInfoCollection]
    B --> D[Criteria objects]
    C --> D
    D --> E[(App_Error)]
    D --> F[(App_Info)]
```

## Sequence diagram
The following diagram shows the primary filtered-search sequence used by the collection objects.

```mermaid
sequenceDiagram
    participant Caller
    participant Collection as Collection object
    participant Criteria as Criteria
    participant DB as SQL Server
    Caller->>Collection: GetAppErrorCollection(...) or GetAppInfoCollection(...)
    Collection->>Criteria: BuildWhere(), BuildOrder(), GetSearchValue()
    Criteria->>DB: RetrieveSQL (TOP 300 rows)
    Criteria->>DB: RetrieveSQLCount (matching count)
    DB-->>Collection: Row set + total count
    Collection-->>Caller: Loaded collection and paging count
```

## Design constraints
- The library has no in-repository project references; all framework behavior comes from packaged dependencies.
- Collection result sets are hard-capped at 300 rows, so callers must use the parallel count query for the full match total.
- `clsAppError.Criteria.DeleteSQL` returns a single-space placeholder instead of executable delete SQL.
- `clsAppError.Criteria.UpdateSQL` contains a trailing comma before `WHERE`, making the text invalid as written.
- `App.config` registers `Oracle.ManagedDataAccess`, but the library's executable SQL uses SQL Server constructs such as `@@IDENTITY`, `TOP 300`, and `CONTAINS(...)`.

## 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
- `Application\SAIF.Application.LogView\clsAppError.vb`
- `Application\SAIF.Application.LogView\clsAppErrorCollection.vb`
- `Application\SAIF.Application.LogView\clsAppInfo.vb`
- `Application\SAIF.Application.LogView\clsAppInfoCollection.vb`
- `Application\SAIF.Application.LogView\clsResources.vb`
- `Application\SAIF.Application.LogView\modLogViewExtensions.vb`
- `Application\SAIF.Application.LogView\SAIF.BOF.Application.LogView.vbproj`
- `Application\SAIF.Application.LogView\App.config`
