Browse Java Design Patterns & Enterprise Application Architecture

Extension Object Pattern

Use the Extension Object pattern in Java when objects need optional capabilities without forcing every capability into the main type hierarchy.

Extension Object is a less common but useful structural pattern for capability-based extension. Instead of putting every optional feature on the main class, the object can expose or discover extension objects that provide extra behavior.

In Java, this can help when:

  • not every instance supports every capability
  • optional capabilities should be added without deep hierarchy growth
  • a plugin-like extension model is needed

It is more specialized than Decorator and usually more niche.

In this section

Revised on Thursday, April 23, 2026