How do you develop?

We hear a lot about development processes these days, but I'd like to know what techniques people actually use? Do you create UML diagrams? Do you map out the states? And when it comes down to the actual code, how do you break it up into classes and packages? Does your methodology vary depending on the type of program you are creating?

When I'm creating a new program I start with a single class and a main method and then grow from there. First I put the minimum functionality in there, just to make sure it works. This is especially helpful if I'm trying out new technology, say a library for generating PDFs.

Once I have the minimum working I start writing down what the finished program should do. Not a complete design document, just a list of functions: what the program should be able to do. From there I start pulling the code into different classes and packages.

I do structure my code differently depending on the type of program it is. For servlets I focus on data modeling, since there is usually a backend of some sort that I'm connecting to. I create classes that represent each underlying object in the system, then I create various handlers to create, manipulate, and store those objects. The UI is constructed on top of that using XSLs or JSPs.

If I'm writing a Swing application I focus on the taskflow of the user. Where will the user start? Where will the user want to go from screen X? How should validation and error conditions be handled? I usually create classes to model each window. All of the code to create the panels, sub panels, and widgets goes in that class. As the size of the class grows I pull the major chunks out (say a reusable subpanel for selecting a date). I make my event handlers anonymous at first and then pull them out into inner classes and later into full classes in an event package.

I've discovered that I have a very iterative way of doing things. Constantly writing and refactoring, growing the application but always making sure it continues to work. Does this mean I unconsciously follow XP?

Talk to me about it on Twitter

Posted December 17th, 2003

Tagged: philosophy java.net