In late 2001 or early 2002 I challenged myself to write a complete web application in java, from scratch in my spare time. Besides learning Struts, I had a couple other reasons to want to complete this project.
The first reason was to practice conception, analysis and, design of a complete system. The idea was to choose a simple domain to make the scope reasonable for my team of one, and then let the experience reinforce and/or reveal best practices and pitfalls.
Secondly, I had come to the conclusion that there is often more value in data, than in software itself. So, I wanted to create, and publicly deploy a site that would capture useful data from internet users.
A few years earlier, on a cross-country road trip, I had taken note of the coordinate system used by interstate truck drivers: mile markers – those little green signs posted every mile of every U.S. Interstate highway. When we asked the truckers for navigation help, their assistance was always in terms of these mileposts.
Remember these where the days before Google maps when GPS systems were not quite as common as they are today.
So, my initial plan was to create a simple site to allow users to
- enter GPS coordinates and a description of a place
- search for previously entered, nearby places
- cross reference latitude-longitude with Interstate mile markers
I think I quickly sketched out these use-cases, a database schema, and a few class diagrams. Then I proceeded to violate an important eXtreme Programming principle: “Do the simplest thing that will possibly work.” Rather than sticking to the plan, I proceeded to create an analysis model that would support all kinds of things. In addition to Places, I modeled, Members, Subjects, Vehicles, Sightings, Reviews, Place Categorization, Access Control etc… Looking back, I believe I thought I would really only implement the original use cases but, I’d build it using this really flexible model. Yeah, that was the first learning. If you want to do something quick, stick to the requirements you have. Don’t get me wrong, the analysis was good and it led to discovery of interesting possibilities. It’s just that I found my self working on a really non-trivial project.
As is the case with some real-world, non-practice, professional projects I’ve worked on, an excessive amount of time was spent on the so-called persistence layer. I tried writing my own JDBC code and quickly decided to look for some framework to leverage. I played with Jaxor and finally settled on Hibernate (1.0 at the time.)
Sadly AskGPS (a.k.a. geomax but, this name was taken) never did get deployed. The prototype however, is an example of a site offering “user generated content” predating the present “Web 2.0” craze. The way the app linked to mapsonus.com, rather than Google Maps now appears quaint. Let me know if you are interested in reviving this effort.
A fair amount of code was written – enough to support the following features:
- create new user
- add place to DB
- search for place in DB
- access control (partially completed.)
- add a Subject
- Search for a Subject
- Add a sighting
- Search for a sighting
I even designed a sticker that folks would use to label the places they’ve added:
Screen Shots and descriptions from earlier documents follow:
Adding a Place to the AskGPS Database
Because AskGPS is a place allowing users to share their geo-spatial experiences, the first feature illustrated is the capability for users to add to the AskGPS database.
The screen shot above shows a form users use to add a place to the database. The form accepts a category, coordinates, a name and a description of the place. In this example, we are adding an imaginary gas station with coordinates that happen to be somewhere in Kansas.
After the category, coordinates, and other information is accepted, the system does a search of US populated places, and shows what is closest to the coordinates of the new place. This is done to help validate the coordinates. In this example, we can assume the user really did mean a gas station 31 miles Northeast of Osborne Kansas.
(In the prototype, the US populated place database is thinned out, to save time in loading the database each time the system is rebuilt during development. With the full US Populated Place Database loaded, we would see more than one populated place neighboring the fake gas station we are adding.)
Finding a Place
Users can search for places by name, coordinates, category, or some combination of these. Here, we will search by name and category. We’ll enter the first letters of the place name – ‘Fa’ for Fake gas station – and select category ‘gas station’. We’ll also select the US Populated Place category just to get some extra hits.
After submitting the search criteria, the system displays search results. Here we see the Fake Gas Station we just entered plus a few US Populated Places with names starting with ‘Fa’. (Evidently the prototype author couldn’t be bothered to format the decimal coordinates properly!)
In addition to the name, and coordinates of each place in the search results, there is a ‘map’ link that would lead to mapsonus. (Remember this prototype was done before Google Maps!)
The result of clicking the ‘map’ link is shown above. If instead the user chooses “map all”, all the search results are displayed: