Skip to main content

Software Architecture

Explore practical guides and implementation patterns for this topic.

Posts

Apex Development

Dependency Injection in Salesforce Apex: Testability & Trade-offs

💬 In plain words: Dependency Injection (DI) simply means a class receives its tools from the outside instead of building them internally. By passing dependencies (like database selectors or API callout classes) into a class, you can easily substitute them with FAKE tools (mocks) during unit tests. This lets you test your core business logic instantly without making real database queries or external network callouts.
Read article
Agentforce

Why Shorter Instructions Win: Optimizing AI Agent Prompts for High Accuracy

💬 In plain words: Every word you add to an AI prompt acts as additional weight for the model to balance. Longer instructions increase the chances that the model gets distracted or ignores core directions. Salesforce explicitly confirms this principle: keeping reasoning instructions concise produces significantly more accurate results. 📌 Example: A Meridian subagent originally used eleven sentences of detailed prompt instructions and consistently misrouted requests. By shortening the instructions to four clear sentences and moving two strict constraints into code logic, the routing accuracy jumped without changing a single downstream action.
Read article