From Adapter to Actor: Architectural Patterns for Integrating AI in Your Application

How you integrate an LLM into your application fundamentally depends on who has control: does your code decide the flow while the LLM just responds, or does the LLM decide what to do next? This distinction leads you to two very different architectural patterns. Pattern 1: LLM as Infrastructure When the interaction is simple—you send a prompt, you receive a response—the LLM is infrastructure. It’s just another external service, like a translation service or geocoding. ...

December 13, 2025 · 5 min · Pascual Montesinos

Domain Events vs Integration Events

In event-driven architectures, it’s useful to distinguish between events based on their purpose: communication within the domain versus integration between bounded contexts. This distinction helps better manage coupling and system evolution. The Context When everything is modeled as “an event,” tensions emerge. A single message attempts to serve two different purposes: Communicate domain facts to coordinate reactions within the bounded context. Expose state changes as an integration contract with other bounded contexts. For example, when a product is put on sale in an e-commerce system: ...

November 21, 2025 · 6 min · Pascual Montesinos