package view; import java.awt.Graphics; /** * Adapter from the view back to the model */ public interface IModelAdapter { /** * Method to paint the sprites back in the model. * @param g The current Graphics context */ public void paint(Graphics g); // other methods elided... /** * No-op singleton implementation of IModelAdapter (Null Object Design Pattern). */ public static final IModelAdapter NULL_OBJECT = new IModelAdapter() { public void paint(Graphics g) { } // other methods similarly coded for no-op }; }