ApexEloquent

Salesforce Apex Framework for Clean Architecture

Query Delegation Pattern

An enhanced Repository pattern specifically designed for Apex development. Business logic constructs queries and repositories execute them. Solves problems with Salesforce's recommended Selector pattern and keeps code clean.

Dynamic Query Creation

Enables flexible query building in Apex similar to Laravel's Eloquent. No more building queries with string concatenation when adding conditions.

Built-in Repository

Standard-equipped with RepositoryInterface and its implementations (Eloquent and MockEloquent) to separate I/O and business logic responsibilities. No need to add classes other than business logic to write tests.
Prevents repository class proliferation in namespace-less Apex, reducing code volume and lowering psychological barriers to writing tests.

Non-writable Field Mocking

Enables mocking of non-writable fields such as formula fields and relationship fields that depend on the database. This allows complete decoupling from database dependencies.

False Positive Detection

MockEntry detects access to fields that weren't selected in SOQL queries, preventing false positive tests. Ensures your tests fail when production code would fail, giving you true confidence in your code quality.

Test Data Factory

MockEntry provides a complete factory system for building sophisticated test data. Create complex mock records with relationships, auto-generated IDs, and dynamic field values using fluent, chainable methods like add(), addParent(), addChildren(), and autoId().

Solving Apex's Fundamental Testing Challenges

❌ The Problems

⚠️Fake tests with zero real coverage

⚠️Impossible to mock system fields and "non-writable" data

⚠️Tight coupling between I/O and business logic

⚠️Slow, unreliable integration tests only

✅ ApexEloquent Solution

True unit tests with real code coverage

Revolutionary mocking of any field or data

Clean architecture with dependency injection

Fast, isolated tests for rapid development

Architecture & Technology

Query Delegation
Dynamic SOQL building
Repository Pattern
Data access abstraction
Dependency Injection
Loosely coupled design
Mock Framework
Complete test isolation
Clean Architecture
Layered responsibilities
SOLID Principles
Maintainable codebase
Test-Driven Development
Quality assurance
Domain-Driven Design
Business logic focus

Ready to Transform Your Apex Development?

Join the revolution in Salesforce development. Build better, test faster, and maintain cleaner code with ApexEloquent.