Smarthome Server History
Evolution
This Visual Basic program is actually the evolution of the oldest part of the system. The original implementation started with the ability to monitor and send commands to the Lynx bi-directional X10 interface through a serial port. From that the program evolved into a program which handled video capture, email, email handling, and all the functions of the smarthome 1 system all in one program with a client program that made requests of it from CGI scripts.
One feature I always wanted was the ability for multiple smarthome servers running on different Windows boxes in the house to be able to interoperate with each other and act collectively. Before I got interested in CORBA, my main option was to use the TCP/IP protocol I wrote for communication between the old client and the smarthome server, but I never did anything with this.
At this stage my home system consisted of each machine running a web server and a smarthome server. I could access each system one at a time.
CORBA, refactoring and initial distributed networking
Once I found VBOrb (the CORBA implementation for Visual Basic) I realized that if I formalized the interfaces between functional areas of the smarthome server, then eventually I’d be able to distribute that function across multiple machines. It also gave me a reason to review the Object Oriented design of the system to eliminate global data in the system. After I wrote the IDL for the components and decided how I would handle error handling and reconnection to CORBA servers, I replaced all calls from one function to another with a call through the new CORBA interface. After that was working I could point one smarthome server at a function provided by a different one and they would interoperate seamlessly.
Migration
One of my ultimate goals was to make the VB code that runs on each machine as “thin” as possible and migrate whatever I could to Linux code. Now that I was using CORBA between all subsystems I could rewrite them one by one in Java, install it on a Linux machine, and remove the function from the smarthome server code. I also re-implemented the CGI scripts that made requests of the servers in Java Server Pages which made direct calls to the CORBA interfaces. This allowed me to eliminate the need for a client program and the kludgy protocol I invented between the client and server. Now the smarthome server is little more than a set of CORBA servers which implement pure function. At this point I was using just one web server which could control all the smarthome servers.