Tagged “Observer”
4 articles with this tag.
- Compound patterns and MVCPatterns rarely appear alone. How Model-View-Controller combines Observer, Strategy and Composite, how Spring MVC maps the idea to the web, MVC versus MVP and MVVM, and other common pattern combinations in real code.
- ObserverNotify many dependent objects automatically when one object changes. A runnable Java 21 event publisher with subscribe/unsubscribe, failure isolation and CopyOnWriteArrayList, push versus pull, lapsed-listener leaks, Spring application events, reactive streams and the step up to messaging.
- Observer vs Mediator vs Event BusThree ways for objects to communicate without direct calls: Observer broadcasts from a subject to its listeners, Mediator centralises coordination logic, and an event bus decouples publishers and subscribers completely. Coupling, control flow, failure handling and how each scales to messaging and sagas.
- Application eventsDecoupling with Spring's event mechanism: publishing events, @EventListener, ordering and conditions, synchronous vs @Async listeners, @TransactionalEventListener phases, built-in lifecycle events, error handling, Spring Modulith's event publication registry, and when to use a message broker instead.