Implicit Invocation

Implicit Invocation #

Implicit invocation is suitable when components producing events/data do not directly know which other components will consume them.

Topology #

Example component diagram:

Publish-subscribe topology

  • Component
    • Publishers: emit events/messages.
    • Subscribers: register interest and react when events arrive.
  • Connector: Events/messages
    • often grouped by topic/channel.
    • publishers do not call subscribers directly; the runtime delivery mechanism handles the fan-out to current subscribers.

Pros and cons #

  • Pros
    • Maintainability: add/remove subscribers without changing publishers; supports pluggable components at runtime.
    • Scalability: asynchronous delivery and buffering can be scaled up to handle spikes.
  • Cons
    • Readability: hidden dependencies between components and unpredictable ordering/timing of execution.
    • Debugging/testing: often needs tracing, structured logging, and careful test harnesses to reason about the execution order.

Variants #

Event-based #

This variant introduces a shared event bus. Components publish events to the bus and subscribe to events from the bus. Compared to direct publish-subscribe, the bus makes routing and buffering explicit.

Event bus variant

Real-world examples #

In-process events (Node.js EventEmitter) #

Many applications use in-process event emitters as a lightweight event bus. Here, the components are publishers (code that calls emit) and subscribers (registered listeners), and the connector is the event type/name and its payload. This is a compact way to do implicit invocation inside a single process.

Further reading: Node.js events / EventEmitter documentation

Brokered publish-subscribe (Apache Kafka) #

Kafka makes publish-subscribe explicit via topics. Producers and consumers are the main components, and topics act like named connectors that carry ordered event streams. Real systems typically add schemas/versioning and delivery semantics (at-least-once vs exactly-once) depending on reliability and performance goals.

Further reading: Apache Kafka documentation

Plugin ecosystems (Eclipse) #

Large extensible applications often rely on implicit invocation so plugins can react to events or extension points without tight coupling to the core. In Eclipse, plugins are the components, and the connectors include extension points, listeners, and event notifications that allow new functionality to “attach” to existing workflows.

Further reading: The Architecture of Open Source Applications: Eclipse