Architecture
- Last UpdatedJul 27, 2026
- 4 minute read
- Engineering
- Integration Service 4.1
- Integrators
This section describes the architecture, design patterns, and internal structure of the SDK.
The SDK is organized in four layers:

Core Components
-
DataApiClientFactory
The primary entry point. Creates typed or generic client instances.
public static class DataApiClientFactory
{
public static T CreateDataApiClient<T>(
string host,
AuthenticationType authType = AuthenticationType.NTLM,
int waitingTimeInMinutesForLiveData = 60,
string token = "",
CancellationTokenSource hubCancellationToken = null
) where T : class;
}
-
BaseClient<TDataSource>
Abstract base class for all typed clients. Provides common HTTP operations and is the Template Method pattern root.
-
Typed Clients
Concrete implementations for each datasource type:
-
EngineeringClient (implements IEngineeringClient)
-
ExcelClient (implements IExcelClient)
-
ERMClient (implements IERMClient)
-
ETAPClient (implements IETAPClient)
-
SimulationClient (implements ISimulationClient)
-
EngineeringDataAPIClient (implements IEngineeringDataAPIClient)
-
-
DataApiClient (Generic)
Implements IDataApiClient. Routes all method calls to the correct typed client at runtime based on the datasource name. Throws for unsupported operations.
-
SignalRHubConnectionFactory
Factory for creating the real-time pub/sub client (ISignalRPubSubClient). Manages SignalR HubConnection lifecycle.
-
HubConnectionManager
Manages the SignalR HubConnection. Supports both NTLM and Connect authentication for hub connections, automatic reconnection, and connection state tracking.
-
HealthCheckClientFactory
Creates IHealthCheckClient for service availability checks.
Client Hierarchy

Design Patterns
Factory Pattern
DataApiClientFactory encapsulates all construction logic, hiding:
-
HTTP client creation and configuration
-
Authentication token injection
-
HubConnectionManager initialization
-
Concrete class resolution via reflection
Template Method Pattern
BaseClient<TDataSource> defines the skeleton of HTTP request handling. Subclasses override datasource-specific endpoint segments. The base class provides:
-
URL construction
-
Request/response serialization
-
Error propagation
Strategy Pattern
AuthenticationType selects the HTTP handler strategy at construction time:
-
NTLM: HttpClientHandler with UseDefaultCredentials = true
-
Connect: HttpClient with Authorization: Bearer <token> header
Dependency Injection
DataApiClientFactory accepts optional IHttpClientFactory and IHubConnectionManager overrides, enabling test mocking and custom infrastructure.
Data Flow

Example: Fetching Data Sources
var sources = await client.GetDataSources(filter);
// SDK flow:
// 1. GetDataSources() called on EngineeringClient
// 2. BaseClient constructs URL: /api/v1/datasources?filter=...
// 3. HttpClient sends GET with NTLM or Bearer auth
// 4. JSON response deserialized to IEnumerable<DatasourceDto>
// 5. Returns to developer
Factory Pattern
Client Creation Process

Authentication Flow
NTLM Authentication
-
CreateDataApiClient<T>(host, authType: NTLM)
-
HttpClientHandler created with UseDefaultCredentials = true
-
Windows domain credentials used automatically
-
HTTP Negotiate/NTLM headers sent with each request
-
DataAPI validates against domain controller
-
Response returned if valid
Connect Authentication
-
Developer acquires token from AVEVA Connect service
-
CreateDataApiClient<T>(host, authType: Connect, token: "…")
-
HttpClient configured: Authorization: Bearer <token>
-
Token sent with each request
-
DataAPI validates token
-
Response returned if valid
SignalR Integration
Hub Connection Lifecycle
-
SignalRHubConnectionFactory.CreatePubSubClient(…) called
-
HubConnectionManager.CreateHubConnectionAsync()
-
HubConnection configured:
-
URL: https://{host}/api/hub
-
Auth: NTLM or Bearer token
-
Reconnect strategy: automatic with backoff
-
-
Connection started and verified
-
Subscribe / Publish operations use the live connection
-
Automatic reconnection on network failure
-
Connection disposed when client is disposed
Message Flow

Exception Hierarchy

Configuration
API Constants (ApiConstants class)
-
Named HttpClient Names:
-
DataAPINamedHttpClientWithNTLM
-
DataAPINamedHttpClientWithConnect
-
-
Default Timeout: 60 minutes for live data acknowledgement
Customization Points
-
Timeout: waitingTimeInMinutesForLiveData factory parameter
-
Authentication: AuthenticationType enum
-
Hub cancellation: CancellationTokenSource hubCancellationToken factory parameter
Extension Points
The SDK is designed to be extended:
-
Custom Clients: Inherit from BaseClient<T> for new datasource types
-
Custom Factories: Implement the factory interfaces for specialized creation
-
Custom Authentication: Add new values to AuthenticationType enum
-
HttpClient Middleware: Configure via IHttpClientFactory override
Thread Safety
-
HttpClient: Thread-safe; designed for reuse across requests
-
Typed Clients: Stateless and thread-safe
-
HubConnection: Thread-safe for subscribe/publish operations
-
Token Management: Caller responsibility to ensure token thread-safety
Performance Considerations
-
HttpClient Reuse: Clients are designed for reuse; avoid creating per-request
-
Connection Pooling: HttpClientFactory handles pooling automatically
-
Async End-to-End: All I/O is async; do not use .Result or .Wait()
-
Hub Connections: Reuse the pub/sub client; do not recreate per message
-
Memory: Large result sets are returned as IEnumerable<T> for streaming
Conclusion
The SDK architecture is built on proven patterns (Factory, Template Method, Strategy) to provide a consistent, extensible interface to the AVEVA Integration Service Data API. The layered approach lets developers work at the right level of abstraction while hiding complex initialization and communication details.