Skip to main content
Version: Next

Data Model and ORM Mapping

Data access in APS v23 relies on a custom abstraction layer integrated into the core (Kernel), optimized for performance and flexibility.

Data Access with SqlHelper

APS uses an ADO.NET wrapper called SqlHelper (located in Avanteam.Kernel). This component encapsulates best practices for using System.Data.SqlClient:

  • Centralized management of connections and transactions.
  • Facilitates execution of stored procedures and T-SQL queries.
  • Caches stored procedure parameters for better performance.

Object-Relational Mapping (ORM)

The mapping between database results and C# objects is handled by custom mapping components:

  • ObjectMapping: Provides a reflection-based mechanism to transfer data between source and target objects.
  • Multi-database support: While primarily used with SQL Server, the core includes base classes like SqlDataSourceBase and OracleDataSourceBase, suggesting an architecture capable of supporting multiple database engines.

Schema Management

The APS data schema is managed programmatically through dedicated classes:

  • APSSchema: Represents the overall schema structure.
  • APSTable and APSColumn: Define tables and columns within the system.
  • APSField: Manages field metadata at the application level.

This approach allows APS to dynamically manage data structures, which is essential for a configurable forms and workflow engine.