Email2Face, a good idea

Jonathan Goodyear‘s ASPSOFT just announced Email2Face, a public database mapping email addresses to photos.  This strikes me as a good and useful idea.  If it gets some traction, it would be nice to have an email client plugin to automatically retrieve them.

http://www.email2face.com/

What I would really like to see is something with a similar results, but rather than be a project from one company, instead be open, scalable, and RESTful; perhaps some mapping from email address to web site containing information about the owner of the address.  For example, agree that for aaa@bbb.com, information will be a http://bbb.com/email/aaa/ and from there have links to specific kinds of information, such as… a face photo.

Rhino and Web Start

We discovered today that by default, Rhino (the Mozilla project’s Java-based JavaScript interpreter) does not work inside of a Web-Start-launched application; it fails with a permission error due to loading of dynamically created classes. After a few minutes of furious searching, it seems that there are surprisingly few mentions of this issue, which affects lots of other tools when used under Web Start; it makes be wonder how many projects are using Web Start.

A solution was forthcoming from Heng Yuan, who described it in detail in a Rhino Bugzilla entry, and provides a solution/workaround as part of his CookXml JavaScript Extension. Mercifully, you need only two classes from that package (which has a BSD-like license). These two classes depend on no other files therein; I’ve posted those for easy download:

CookXmlRhinoWebStart.zip

The lines needed to invoke them look like this:

// org.mozilla.javascript.Context

context.setOptimizationLevel(-1);

ProxyJavaAdapter.init(context, scope, true);

Hints at Win32 Deprecation

I just read today (wow, where have I been?) about the issue with Win32 binaries under the (delayed) Vista version of Windows – most notably, that Win32 binaries will need to be signed, otherwise they will provide a, er, “downlevel” user experience. A proposed workaround is to code to another runtime environment (.NET, Java, Ruby, you name it) so that getting the actual Win32 binary signed is someone else’s problem.

This reminded me of comments I made a few years ago, closer to the dawn of .NET: that if .NET works out well, native binaries will end up deprecated, supported for a long time but in the same way that we can still run an ancient DOS “.com” binary on Windows XP… i.e. not really as first-class citizens. At the time I got rather negative feedback to such a comment, but now the Vista feature above seems like the first step in that direction.

Update: As far as I know, this feature did not make it in to Vista – unsigned EXEs are still OK.

To Wrap, or Not To Wrap (Jemmy)

Yesterday I mentioned a talk by Mike Feathers about API design.  One of the topic of API wrapping, which we do frequently here at Oasis Digital, for a variety of reasons.

By coincidence, today the question came up of whether we should wrap the API of Jemmy, a Swing GUI testing tool.  Our natural inclination is to wrap.  But there are oppossing forces as well.  Here’s where I ended up:

  • The Jemmy API is large, and thus tedious to wrap.  (Which might be a good reason to wrap it…)
  • We haven’t used Jemmy much yet, so we don’t have any real idea what subset of its API we will use.
  • We haven’t done much GUI test automation yet, so we have little reason to think we know much about API design for that.
  • There are developers “out there” who know how to use Jemmy. Perhaps we will hire one, and benefit from them already knowing how it works.
  • Thus, we should start out using Jemmy as-is.
  • Once we have a moderate body of code (enough to understand out use, but not so much that revamping it would be burdensome), review this decision and decide whether to wrap it.

Michael Feathers at XPSTL

This evening at XPSTL, Michael Feathers (blog) (book) was in from out of town (and from around the world) and gave a talk on API design. He’s been thinking a lot about API design recently, driven by issues that come up with working with legacy code, which talks to lots of APIs, to cajole it in to a more testable state. I think there is a lot to say (maybe a book’s worth?), and a lot of what has been said elsewhere turns out to yield APIs that are unduly difficult to build testable code with.

What we end up doing here, and a thing that Michael says is not at all unusual, is to “wrap” most APIs with some application code, to enable:

  • a simplified way to call the external component / API, more suited to our needs
  • easy testing, as we can design our wrapper to make it trivial to substitute a test/mock implementation
  • a buffer from future changes in the external component / API
  • easier migration to alternate implementation of the same underlying services

Our wrappers tend to be “flatter” and simpler than the underlying APIs we wrap. For example, most of our use of Hibernate is behind a class we call DataSession, which represents the connection/session, transactions (it encodes our policies on how to use transactions) and many named methods for query operations (thus we avoid scattering HQL or SQL around the project).

Also, we had a big crowd at XPSTL – the room was packed.

Sutter Concurrency Talk – We Need Better Languages

I’ve seen lots of links to Herb Sutter‘s talk at PARC on concurrency. This is a great talk – I found it a little tough to make it through his paper on the topic, while the talk is a joy to experience, information-dense yet approachable. Some thoughts and notes:

  • There weren’t very many people in the audience – I’d have loved to fill one of those empty chairs.
  • He mentioned OO being invented decades ago… passed on the opportunity to mention that much of it happened right there at PARC.
  • I looked at Erlang some months ago after Joel Reymont described his experienced with it.  Erlang is worth looking at again, in depth.
  • For those of us who make a living by staying on the front slope of the adoption curve, the time is now (or past…) to build systems that run as a large number of separate threads of execution, to learn to build and use abstractions over concurrency, to run operations on a clusters of multi-CPU, multi-core PCs, etc.
  • We need to use languages that let us build new abstractions and new kinds of abstraction.  With such a language, if I wanted something like Herb’s “once {}” construct on slide 17, I could add it.

Weiqi pointed out Herb’s double-checked-locking comments.  I did in fact know that DCL was broken and is now fixed… but have generally sworn off its use anyway.  Life is too short to worry about whether we’re sure the right JVM will be used for each block of code we write.

One nit I have to pick is that the PARC site offers only an “mms://” streaming link for the video… I worked for me this time, but in general I’ve had far better results with plain old HTTP downloads and local playback, particularly if I’m not able to watch all in one sititng.