Skip to main content
Async Method Invocation

Intent

Asynchronous method invocation is a pattern where the calling thread is not blocked while waiting results of tasks. The pattern provides parallel processing of multiple independent tasks and retrieving the results via callbacks or waiting until everything is done.

Also known as


iluwatarAbout 3 minConcurrencyAsynchronousReactiveScalability
Callback

Intent

Callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time.

Also known as

  • Event-Subscription
  • Listener

Explanation

Real world example


iluwatarAbout 2 minFunctionalAsynchronousDecouplingIdiomReactive
Collection Pipeline

Intent

The Collection Pipeline design pattern is intended to process collections of data by chaining together operations in a sequence where the output of one operation is the input for the next. It promotes a declarative approach to handling collections, focusing on what should be done rather than how.


iluwatarAbout 3 minFunctionalReactiveData processing
Combinator

Also known as

  • Function Composition
  • Functional Combinator

Intent

The Combinator pattern is intended to enable complex functionalities by combining simple functions into more complex ones. It aims to achieve modularization and reusability by breaking down a task into simpler, interchangeable components that can be composed in various ways.


iluwatarAbout 3 minFunctionalIdiomReactive
Event Aggregator

Also known as

  • Message Hub

Intent

The Event Aggregator design pattern aims to reduce the direct dependencies between multiple systems and components that need to interact by introducing a single component, the Event Aggregator, that receives events from multiple sources and distributes them to multiple listeners.


iluwatarAbout 3 minMessagingDecouplingEvent-drivenReactive
Event-Based Asynchronous

Also known as

  • Asynchronous Event Handling

Intent

The Event-Based Asynchronous pattern allows a system to handle tasks that might take some time to complete without blocking the execution of the program. It enables better resource utilization by freeing up a thread that would otherwise be blocked waiting for the task to complete.


iluwatarAbout 3 minConcurrencyAsynchronousDecouplingEvent-drivenFault toleranceMessagingReactiveScalability
Event-Driven Architecture

Also known as

  • Event-Driven System
  • Event-Based Architecture

Intent

Event-Driven Architecture (EDA) is designed to orchestrate behavior around the production, detection, consumption of, and reaction to events. This architecture enables highly decoupled, scalable, and dynamic interconnections between event producers and consumers.


iluwatarAbout 3 minArchitecturalAsynchronousDecouplingEnterprise patternsEvent-drivenMessagingPublish/subscribeReactiveScalability
Fluent Interface

Intent

A fluent interface provides an easy-readable, flowing interface, that often mimics a domain specific
language. Using this pattern results in code that can be read nearly as human language.

Explanation

The Fluent Interface pattern is useful when you want to provide an easy readable, flowing API. Those
interfaces tend to mimic domain specific languages, so they can nearly be read as human languages.


iluwatarAbout 2 minFunctionalReactive
Monad

Intent

Monad pattern based on monad from linear algebra represents the way of chaining operations
together step by step. Binding functions can be described as passing one's output to another's input
basing on the 'same type' contract. Formally, monad consists of a type constructor M and two
operations:
bind - that takes monadic object and a function from plain object to monadic value and returns monadic value
return - that takes plain type object and returns this object wrapped in a monadic value.


iluwatarAbout 2 minFunctionalReactive
Observer

Also known as

Dependents, Publish-Subscribe

Intent

Define a one-to-many dependency between objects so that when one object changes state, all its
dependents are notified and updated automatically.

Explanation

Real-world example

In a land far away live the races of hobbits and orcs. Both of them are mostly outdoors so they
closely follow the weather changes. One could say that they are constantly observing the
weather.


iluwatarAbout 2 minBehavioralGang Of FourReactive