Home Segments Top Top Previous Next

910: Mainline

Following good programming practice, in preparation for defining your new panel, you define an interface:

public interface RatingPanelInterface { 
 // Setters 
 public abstract void setValue1 (int value) ; 
 public abstract void setValue2 (int value) ; 
 public abstract void setValue3 (int value) ; 
 // Getters 
 public abstract int getValue1 () ; 
 public abstract int getValue2 () ; 
 public abstract int getValue3 () ; 
} 

The interface shows good taste in that none of the setters and getters have names that hint of movies, thus adhering to the principle that views should exhibit no knowledge of a particular domain. Any view that implements the interface will serve well whenever three values are to be displayed and manipulated.