CS257 Assignment: Weather Display

Due Friday, 4/14/04. Submit via HSP. You may design together (see below), but I would like each of you to write your own code.

For many years, a small weather station on the top of Carleton's Olin Hall has been collecting information about temperature, humidity, pressure, wind speed and direction, rainfall, etc. In the early nineties, when I first became aware of the weather station, it was dumping its data onto a hard disk attached to a Macintosh SE, and few people outside the physics department were aware it existed at all. A few years ago, however, Doug Foxgrover (then in the physics department, and now in ITS) supervised some students and an intern in the creation of a web interface for the Carleton weather station. Ultimately, this web site will give access to the past century's worth of weather data. For now, it is a wonderful and addictive tool for looking at local weather patterns during the past five years or so.

Undoubtedly, there are thousands of small local weather stations with some kind of web presence. For this assignment, you are going to write a Java program to collect data from at least two such sites and display it in real time.

Your program

When your program starts up, it will start collecting temperature data from your selected weather sites. Carleton's site, for example, updates approximately once every five minutes, so your program should reload data from weather.carleton.edu once every five minutes or so. For your other site(s), you should choose source data that is also updated frequently.

Your program should display, in a reasonably compact window:

You will need to display this information for both of your locations. You can do this either by giving the user a way to select the location, or by showing both locations side by side, or some other way you consider suitable.

If you get fired up and want to add more than these minimal features, go right ahead. Just make sure the minimal requirements don't get sacrificed for fancy extras.

What to hand in

Hand in source code and a readme. The readme should discuss your design, your command-line syntax, and the status of your program.

Advice

I designed the assignment to give you practice in many aspects of software development, but especially in the area of object-oriented design. In this problem, several important objects and relationships between objects come to mind naturally. For example, you should probably have some sort of class that has responsibility for contacting a web site and collecting the data. This class should have a public interface that allows other objects to ask it for data (e.g. give me your most recent temperature and its time, or give me a vector of time/temperature pairs). It will also need to be able to retrieve and parse the data--whether it should contain its own timer code, or whether it should have a public method called "retrieve" is one of the design decisions you will need to make.

I strongly urge you to spend a lot of time up-front developing a design for your program. What classes do you need, and how many instances of each? What responsibilities will these classes have? Is inheritance an appropriate tool, and if so, where? Are there design patterns that would apply to this situation? Which ones, and how?

In fact, I encourage you to develop designs with each other, in pairs or even larger groups. As I said above, I want you each to do your own implementation, but group-generated designs are welcome. Don't forget to credit your co-workers in your code and/or documentation.

While you are working carefully on your design, you can also do some prototyping and bottom-up kinds of coding. For example, you will need to figure out how to use timers, and how to get the source for a given web page, and how to draw lines and text in a window. These are problems that you can work on in small experimental programs before your overall design is ready, because you know you will need to solve them eventually.

Start early (really!), have fun, and keep in touch.