concept domain event in category dependency injection

appears as: domain events, domain event, domain events, domain event
Dependency Injection

This is an excerpt from Manning's book Dependency Injection.

  • With domain events, you capture actions that can trigger a change to the state of the application you’re developing.
  • Listing 6.7 INotificationService with a growing number of methods
    public interface INotificationService
    {
        void OrderApproved(Order order);    #1  
        void OrderCancelled(Order order);    #1  
        void OrderShipped(Order order);    #1  
        void OrderDelivered(Order order);    #1  
        void CustomerCreated(Customer customer);    #1  
        void CustomerMadePreferred(Customer customer);    #1  
    }
    
    #1   Each method represents a domain event. Abstractions with many members, however, typically violate the Interface Segregation Principle, which we'll discuss in section 6.2.1.

    Within any system of reasonable size and complexity, you’d easily get dozens of these domain events, which would lead to an ever-changing INotificationService interface. With each change to this interface, all implementations of that interface must be updated too. Additionally, ever-growing interfaces also causes ever-growing implementations. If, however, you promote the domain events to actual types and make them part of the domain, as shown in figure 6.4, an interesting opportunity to generalize even further arises.