My Work at DigitalXtractions

 

DigitalXtractions can be found here.

Here is the simplified story of my experience developing the SCIRC and associated applications. When I started at DigitalXtractions Marc Blumenfeld, founder and president, handed me a Cingular 2125 and said "Make it take pictures automatically, and send them to the Internet."

Of course we had bigger plans then just that, but it was a good place to start, as we created the worlds first Self Contained Internet Remote Camera or simply, the SCIRC. The idea is that we wanted to create a web camera that could be placed anyplace and work without plugging it in. A programmable cell phone was a perfect choice (so we thought) to use as a prototype. It had a CPU, some flash, a cell modem and a camera. We wanted just a power button, no other way to interact with it, people would control it from a web page.

This got me started working with two new technologies, C# and Visual Studio with the embedded developer tools. My experience with Java paid off while learning C#, it really is as similar as people say. One pain point with C# was the amount of third party software available, not much, and the basic libraries have some huge holes. For example, it took me a long time to figure out how to programmatically uncompress a file.

Visual Studio turned out to be much like other IDEs and the embedded tools integrate reasonably well. Once you get an interesting application running and start debugging an application running on a phone, you can see just how cool Windows Mobile is under the hood. I have had a lot of experience with Netbeans and some experience tinkering with Sun's embedded tools, Netbeans blows the doors off Studio in features and usability, but I think MS's mobile debugger is better.

I set up a number of web services by generating server code from a WSDL file and hosted the resulting Java classes in an instance of Sun Java System Application Server 9. After some fiddling with end point address and what not, I was relived when Visual Studio found the hosted WSDL, generated classes, and it worked, the phone could authenticate with my services.

Back to Java, my first love

On the server side I wanted to take advantage of as much of Java EE 5 as I could. I had worked with Hibernate at Children's and knew it was really the only way to persist Object in a database. I know there are other OR mapping technologies, and I am sure they work, they are all better then writing countless boring SQL statements. Since JPA is based largely on Hibernate I decided to use JPA for the persistence layer. Java EE 5 comes with Toplink Essentials , an Oracle implementation for JPA, it seemed to work ok, but I could never get it to work out of container. I wanted to use JPA out of container for unit testing, since Netbeans 5.5 does not have the best in-container testing features.

So I had SOAP based web services implemented by simple annotated classes, which could access a persistence layer via JPA which was backed with Apache Derby which comes with J2EE these days. Now I had platform I figured I could expand as required. I could expand the functionality of the system simply by adding new web services, I could expand the scalability of the system by moving the database to a second machine and I could put the web services on as many load balanced servers as I wanted.

While I was sorting out how the back end should work, we hired an RIT coop to figure out how to capture images from the camera on the 2125 using Direct Show. Previously we had used a hack to take pictures using the standard capture image dialog, which took about 10 seconds to bring up and capture a picture. Ryan, to coop did figure out how to capture images without the dialog, but they where fuzzy and had bad lighting. We tried to find details about the drivers, but alias we where firmly in the hands of closed source cooperations, and they did not hand out driver code to small startups.

GWT and the SCIRC Portal

Our SCIRC was capturing images, uploading to our server via our web services and safely in our database, now we needed a UI. I had hand rolled my own AJAX framework while at children's, at the time only the most basic frameworks where available or at least popular, anyway, I knew I could reuse that code (LGPL) if I wanted, then I discovered GWT. The Google Web Toolkit is a Swing programmers dream come true. Events, components, layout managers, the whole thing. I used GWT to implement what we called the Portal, a web application our customers could use to view and manage their SCIRCs.

SCIRC Portal

One problem was integrating all my POJOs to the frameworks I has chosen. Remember I was generating my source from a WSDL, so that generated POJOs with XML serialization annotations, I hand added to those POJOs the annotations required for JPA, so they where pretty complicated Plain Old Java Objects by then. GWT does not know what to do with annotations and never mind XMLGregorianCalendars, GWT wants java.util.Dates. I copied all of my POJOs, removed the annotations and replaced problematic classes. Then I wrote a converter, so on the server side of the GWT application I could just convert between GWT versions of my POJOs and my XML/JPA versions.

SCIRC Portal

After all that set up, technically I was using different classes and even languages on for the three elements of the application, the SCIRC, the server and the UI. However, these different APIs all shared the same grammar, all had the same simple names for the classes. A real joy to work with at this point. I would love to implement another application using this set of technologies, it would really come together quick I think. There was this awesome moment when I was debugging a feature, I had the 2125 running in debug mode, connected to windows running in my Mac, in Netbeans (in OS X) I was running my GWT application in debug mode, I hit a button, the debugger stops at a break point in netbeans, I hit go, the server logs the request, the 2125 gets the message I just sent and Visual Studio hits a break point in the C# code. I look back at the GWT application, it's hanging waiting for me to hit go in Visual Studio! I hit go, the server logs the response, the GWT updates. Awesome!

SCIRC Portal

Of course the whole time I am implementing this thing, I am making web pages, fixing people computers, running into countless snags on the Cingular 2125, managing employees and bosses. A start up is a lot of work, I hope DigitalXtractions finds some luck, they have a great product.