Both your example and the Java one are not abstract enough (although the added string conversion is nice.) I was expecting more design patterns and layering for a truly enterprise-quality solution, like this:
This is my favorite comment :-) After years of programming in enterprise Java, I failed to truly make it enterprise worthy! I'm going to see if I can get an assembly example added per your other comment.