Browse Java Design Patterns & Enterprise Application Architecture

Implementing Marker Interfaces

Understand when marker interfaces still make sense in Java and why annotations now cover many metadata uses more cleanly.

Marker interface: An interface with no methods that signals some semantic property through type membership alone.

Classic Java examples include Serializable and Cloneable.

What Marker Interfaces Are Good At

Marker interfaces are useful when the signal should participate in the type system. A method can require a marker interface at compile time, and tools or frameworks can inspect type membership directly.

Their Limits

Marker interfaces cannot:

  • carry additional data
  • target methods or fields easily
  • express nuanced configuration

That is why many modern metadata use cases are better expressed with annotations.

Review Rule

Use a marker interface when type membership itself is the important contract. Use annotations when metadata needs more expressiveness.

Revised on Thursday, April 23, 2026