Published Jun 26, 2017

Strategic Design and Domain Events

Unravel the intricacies of integrating new systems with legacy architectures through anti-corruption layers, domain events, and strategic design, as hosts Joe Zack and Alan Underwood discuss maximizing system integrity and enhancing modularity in software architecture.
Episode Highlights
Coding Blocks logo

Popular Clips

Episode Highlights

  • Domain Events

    Domain events play a crucial role in software architecture by capturing past occurrences within a domain, such as processed orders or payments. explains that these events should include a timestamp and relevant entity IDs to facilitate subsequent actions. Raising a domain event should not trigger side effects within the originating object, allowing external services to respond independently.

    Raising the event should have no side effects or behaviors.

    ---

    likens this to a pub-sub model, where listeners react to events like a light blinking when an order is placed 1.

       

    Pattern Benefits

    The domain events pattern is a lightweight pub-sub model that decouples system events from business logic, enhancing system interactions. highlights the importance of encapsulating domain models to maintain consistency and avoid side effects. By adding events to a collection rather than directly firing them, systems can prevent race conditions and ensure testability.

    Instead of saying, you know, raise domain event here, and then creating a new one, instead of that, you add it to an events collection.

    --- Alan Underwood

    This approach allows new services to integrate seamlessly without altering existing code, fostering a clean and modular architecture 2 3.

       

    Implementation Insights

    Implementing domain events requires careful consideration of practical implications, such as concurrency and event timing. suggests using timestamps to manage race conditions and concurrency issues effectively. This strategy aligns with the augmented domain-driven design patterns discussed in the Pluralsight course by Julie Lehrman and Steve Smith.

    If you timestamp that thing, that can tremendously help you out because that could also take care of any race conditions.

    --- Alan Underwood

    adds that understanding the lifecycle of events, like those in extjs, can provide insights into managing domain events efficiently 4 5.

Related Episodes