white bar background yellow bar background
Colorado Software Summit 2007 banner
Colorado Software Summit logo

The Best Way to Master a Technology Is to Teach It to Others

Scott Davis

OpenLogic

Mocking Web Services

As more software engineers add unit testing to their everyday development regime, the concept of mock objects is becoming increasingly popular. Mock objects proxy more complicated objects, fulfilling their doppelganger's interface and behavior for testing purposes. Coding to interfaces instead of implementations is a best practice that applies equally well to POJOs and Web Services.

Web Services, too, are being added to our toolkit with increasing frequency. Building a true service-oriented architecture brings with it new challenges: how do you code against an external service? If that service is metered, how do you develop iteratively without using up your production budget in tests? How do you write assertions against asynchronous services? How do you capture performance metrics in your test suite?

These questions and more are answered in this talk. We will look at popular examples of SOAP, REST, and JSON-based web services. Not only will you gain exposure to the services offered by popular websites like Google, Yahoo, Amazon, and eBay, you'll learn how testing their services is just as easy as testing your own codebase.

Real World AJAX

The release of Google Maps was a "Wizard of OZ"/Technicolor moment for web developers everywhere. New terms like AJAX (Asynchronous JavaScript and XML) were popularized overnight, but this is no passing fad. This is a whole-scale paradigm shift in web development, best captured by the evocative phrase "Web 2.0".

While the eye-candy of draggable maps and fade effects are undeniably cool, there is a solid engineering underpinning to AJAX that has nothing to do with special visual effects. As the name implies, Asynchronous JavaScript and XML offers developers no less than the ability to create multi-threaded websites that were once victims of the coarse-grained HTTP request/response cycle. Web Services are every bit as important to AJAX developers as are look-and-feel improvements.

We'll start with a simple, traditional website and progressively AJAX-ify it. Prototype and script.aculo.us are Open Source JavaScript libraries that help mitigate cross-browser compatibilities issues while adding giant strides in developer productivity. DWR (short for Direct Web Remoting) allows you to expose your existing Java objects across the web via a JavaScript interface. These libraries, coupled with real world code examples, will have you well on your way to becoming a 21st-century web developer.

Photo of Scott Davis

Scott Davis is a senior software engineer at OpenLogic. He is the co-author of JBoss At Work (O'Reilly), quite possibly the world's first agile J2EE book. He is also responsible for Google Maps API: Adding Where to Your Application (Pragmatic) and the forthcoming Pragmatic GIS (Pragmatic).

Email: scott@davisworld.org