Rapid Prototyping

Before you do a lot of work on the big program, try the code out in a little program.
  • Keep a directory just for these prototypes and tests.
  • Make the code Q&D, but make it work.
  • Keep these little bits of code forever.
  • Search through them when you think you've "done that before."
import java.net.*;
public class ExplainURL {
    public static void main(String[] args) {
        URL url = null;
        try {
            url = new URL("http://www.grdurand.com");;
        } catch (MalformedURLException e) {
            e.printStackTrace();
            System.exit(0);
        }
        System.out.println(url);
        System.out.println("getAuthority=" + url.getAuthority());
        System.out.println("getProtocol="  + url.getProtocol());
        System.out.println("getHost="      + url.getHost());
        System.out.println("getPort="      + url.getPort());
        System.out.println("getPath="      + url.getPath());
        System.out.println("getFile="      + url.getFile());
        System.out.println("getRef="       + url.getRef());
        System.out.println("getQuery="     + url.getQuery());
    }
}
    ShowSystemProperties.java
    TestInitializer.java
    DemoNoThreadLockUp.java
    Literals.java
    GetIPAddress.java
    TestDataFormat.java
    TestLineEndings.java
    TestPropNeedsTrimming.java
    ListPorts.java
    TestByteArrayOutputStream.java
    ExplainURL.java
    ByteBuffer.java
    TestExec.java
    TestOptionPane.java
    TryMLL.java
    ExploreHTTPHeaders.java
    TestButtonBox.java
    CVSWrap.java
    PasswordTest.java
    MyServerSocket.java
    TestDoubleParsing.java
    TestExpression.java