Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created June 18, 2025 17:36
Show Gist options
  • Select an option

  • Save trikitrok/07580367f29198fcea8b967508da1143 to your computer and use it in GitHub Desktop.

Select an option

Save trikitrok/07580367f29198fcea8b967508da1143 to your computer and use it in GitHub Desktop.
with notifications coupling is reduced
public class ProcessOrder {
private EventPublisher eventPublisher;
// ... code omitted for brevity
public void execute() {
// business logic to process an order (code omitted for brevity)
// ...
// notification of the event that an order has been processed
eventPublisher.publish(createOrderProcessedEvent());
}
// ... code omitted for brevity
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment