O'Reilly logo

Extreme Programming Installed by Chet Hendrickson, Ann Anderson, Ron Jeffries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Model First

When you're creating a GUI, you should develop and test the model first. We'll assume this has been done and that it has the following interface:

               public class SearcherFactory {
                   public static Searcher get(String s)
                           throws IOException {...}
               }

               public interface Searcher {
                   public Result find(Query q);
               }

               public class Query {
                   public Query(String s) {...}
                   public String getValue() {...}
               }
               public interface Result {
                   public int getCount();
                   public Document getItem(int i);
               }

               public interface Document {
                   public String getAuthor();
                   public String getTitle();
                   public String getYear();
               }

In testing and developing the GUI, I don't mind depending on the interfaces of the model; I'm less happy when I have to depend on its concrete classes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required