Current writing
Earlier writing / Software engineering

Action at a Distance

On this page · 2 min read
  1. Make the path traceable
  2. Cross-cutting behavior can still be useful
  3. A practical review

Revised October 19, 2026. What changed

Action at a distance makes local behavior depend on something difficult to discover elsewhere. A method changes a field, but a global callback, interceptor, or mutable registry changes what that action means.

Make the path traceable

Imagine a payment method that appears to save a record while an interceptor also sends a receipt. A developer retries the method after a timeout and sends two receipts. The problem is the hidden side effect and missing retry contract, not the mere presence of an interceptor.

Put consequential effects behind an explicit operation with an idempotency key. Record the triggering request and the resulting external operation. In a debugger, log, or trace, a reader should be able to follow the path from the caller to the effect.

Cross-cutting behavior can still be useful

Instrumentation, transaction boundaries, and access checks often belong in shared middleware. Keep those rules declared, narrowly scoped, and testable. A trace span can make an interceptor more visible than a manually copied convention. A hidden rule with broad matching and no observability does the opposite.

A practical review

List the side effects a caller can trigger, where their configuration lives, and how retries behave. Disable or alter one policy in a test and verify the resulting behavior is understandable. If a local change unexpectedly affects unrelated callers, narrow ownership before adding another special case.

The earlier title typo and partial AspectJ fragment have been removed. This article describes the design problem without presenting an incomplete aspect as executable code.

Search titles, article text, and concepts.

Start typing to search the writing.