Tuesday, November 14, 2006

at your service

We had a couple off site trips today. One was a planned install, the other was to go check out a server that was having problems, and didn't yet have remote access setup. We quickly figured out what was causing the web server grief, which we happened to have a fix for, in addition to a couple additional fixes I had brought with me on a thumb drive. That is when we decided to do some extreme programming on-the-spot. The customer had a feature request to collect some information about the services that were installed on their monitored machines. We reloaded the web and back-end services in slime, and started hacking away with the customer watching over our shoulders. Jasko and I tag teamed on the keyboard, and in about 30 minutes had it knocked out and running.

There are a couple takeaways for me from the experience.

First: emacs. despite the fact that Jasko prefers Eclipse to emacs, we had a fully functioning development environment running on a crappy VGA terminal window with only a keyboard. emacs, M-x slime and we were off and running. Sure, having more code visible on screen would have been very nice, but it was perfectly usable.

Second: macros. A major aspect of why it took us so little time to add the new functionality was that the hard work had been done once with the creation of macros, and we just drafted behind. The entire effort in adding the data collection to the back-end was three lines:

(defpropquery query-services
"service" ("name" "description")
'services "service" (:name :description))

What you don't see is the 20-line macro that does all the magic in the background. It takes those three lines, and creates the code to query the remote agent, collect up the results, update the database, see if there were any changes to the properties, and log any events that might have occurred. The same thing was true in the database code, as well as the ucw components for the front-end.

Labels: ,


Post a Comment

<< Home