-
Notifications
You must be signed in to change notification settings - Fork 0
Release Notes
The Apex Orbit Framework (AOF) is a lightweight, scalable, and easy-to-use Salesforce Apex framework designed to streamline development and enforce best practices. This initial release provides a complete implementation of a trigger framework with separation of concerns, robust error handling, and security enforcement.
- Layered Architecture: Clear separation between Trigger Handler, Domain, Selector, Service, and Unit of Work layers
- Single Trigger Per Object: Simplified trigger management with predictable execution order
- Bulkification: All components designed to handle collections of records efficiently
- Security Enforcement: CRUD permission checks at commit time in the Unit of Work
- Error Handling: Asynchronous logging via Platform Events and custom objects
- Bypass Mechanism: Static methods to bypass triggers when needed
- Comprehensive Documentation: Detailed guides, examples, and architecture diagrams
-
AOF_TriggerHandler.cls- Base trigger handler for orchestrating trigger execution -
AOF_Application_Domain.cls- Base domain class for SObject-specific business logic -
AOF_Application_Selector.cls- Base selector class for querying data with security enforcement -
AOF_Application_Service.cls- Interface for service layer components -
AOF_Application_UnitOfWork.cls- Unit of Work implementation for transaction management -
AOF_ErrorHandlerService.cls- Error logging service using Platform Events -
AOF_SecurityException.cls- Custom exception for security violations
-
AOF_AccountDomain.cls- Example domain implementation for Account object -
AOF_AccountSelector.cls- Example selector implementation for Account object -
AccountTrigger.trigger- Example trigger implementation using the framework
-
AOF_Application_Domain_Test.cls- Tests for the domain layer -
AOF_Application_Selector_Test.cls- Tests for the selector layer -
AOF_Application_UnitOfWork_Test.cls- Tests for the Unit of Work -
AOF_ErrorHandlerService_Test.cls- Tests for the error handling service
-
Naming Convention: All framework components use the
AOF_prefix to prevent naming conflicts - Code Quality: Follows Apex PMD best practices with no empty block statements or System.debug calls
- Test Coverage: Comprehensive test classes with System.runAs() for proper user context testing
- Error Handling: Platform Events for asynchronous error logging to prevent transaction failures
- Security: Object-level CRUD checks performed at commit time in the Unit of Work
- Scalability: Designed for orgs with 10,000+ users with focus on governor limit optimization
-
Platform Event:
ErrorLogEvent__ewith fields:-
Timestamp__c(DateTime) -
OriginatingClassName__c(Text) -
OriginatingMethodName__c(Text) -
LineNumber__c(Number) -
ErrorMessage__c(Long Text Area) -
StackTrace__c(Long Text Area) -
SObjectType__c(Text) -
RecordIds__c(Text) -
Severity__c(Picklist)
-
-
Custom Object:
Error_Log__cwith corresponding fields to store error data
- Create the required Platform Event and Custom Object
- Deploy all Apex classes with the
AOF_prefix - Create a trigger on
ErrorLogEvent__eto persist records toError_Log__c - Implement SObject-specific domain and selector classes as needed
- Create single triggers for each SObject that call the framework
- Create one trigger per SObject that delegates to the framework
- Implement business logic in domain classes, not directly in triggers
- Use selectors for all database queries to ensure security and optimization
- Register DML operations with the Unit of Work rather than performing direct DML
- Implement proper error handling using the provided error service
- Custom metadata-driven configuration not included in this version
- Field-level security (FLS) enforcement in selectors relies on WITH SECURITY_ENFORCED
- Error logging requires proper setup of Platform Events and a subscriber trigger
- Custom metadata-driven trigger configuration
- Enhanced field-level security enforcement options
- Additional utility methods for common operations
- Integration with Salesforce Platform Cache for optimization
- Support for custom permission-based feature toggles
© 2025 Apex Orbit Framework. All rights reserved.

Home
Quick Start
Usage Guide and Examples
Metadata‐Driven Trigger
Best Practices
Core Principles
Framework Architecture and Layers
Trigger Handler Layer
Service Layer
Domain Layer
Selector Layer
Unit of Work Layer
Error Handling Framework
Trigger Execution Flow
Scalability and Performance
Security Considerations
Core Components In-Depth
Error Handling In-Depth
Customization and Extension