A Java example of the gateway design pattern .