and typesafe. "Flexibility" here means that need not refer to or in any way, as the switching of forwarding is abstracted from . In this example, class can forward to any class that implements an interface . Class has a method to switch to another forwarder. Including the clauses improves type safety, because each class must implement the methods in the interface. The main tradeoff is more code. interface I { void f(); void g(); } class A implements I { public void f() { System.out.println("A: doing f()"); } public void g() { System.out.println("A: doing g()"); } } class B implements I { public void f() { System.out.println("B: doing f()"); } public void g() { System.out.println("B: doing g()"); } } // changing the implementing object in run-time (normally done in compile time) class C implements I { I i = null; // forwarding public C(I i){ setI(i); } public void f() { i.f(); } public void g() { i.g(); } // normal attributes public void setI(I i) { this.i = i; } } public class Main { public static void main(String[] arguments) { C c = new C(new A()); c.f(); // output: A: doing f() c.g(); // output: A: doing g() c.setI(new B()); c.f(); // output: B: doing f() c.g(); // output: B: doing g() } } Applications Forwarding is used in many design patterns. Forwarding is used directly in several patterns: Chain-of-responsibility pattern Decorator pattern: decorator object adds its own members, forwarding others to the decorated object. Proxy pattern: proxy object forwards member use to real object. Forwarding may be used in other patterns, but often use is modified; for example, a method call on one object results in several different methods being called on another: Adapter pattern Bridge pattern Facade pattern References Object-oriented programming Articles with example Java code