A prayer to the (demi-)gods of URI
by Robert Cooper
I was looking at This post at j.n about JSR-262 and exposing MBeans as ws-Management SOAP services. All in all, it is a good idea, and seems like a dunk in the water a no-brainer that people would want this functionality, and it follows well with the trend of mapping Java APIs (javax.transaction) to their ws-* equivalents (ws-AtomicTransaction). Bully on!
What stood out in my mind was the URI scheme used:
for SOAP vs
What am I getting at? "service:jmx:ws:" is stupid. While service:jmx:http: might seem a little non-specific, why not service:jmx:ws:http:? Specifying an on-top-of-something-else application definition in a URI is all well and good, but "ws" is (a) a bad designator, "soap" would be better, and (b) doesn't offer any alternative protocols. You can run SOAP over any old thing, and people do. While service:jmx:ws:mailto: might seem like overkill for this particular application, what about service:jmx:ws:https? Seems like that is a pretty common thing people might want to do, don't cha know.
This isn't the first time I have seen stuff like this. It started with people using feed:// as a schema space for RSS/Atom feed, replacing http:// so they could map URIs out to the browser. Fortunately, later evolutions of this came to use feed:// and feed:http:// interchangeably. Apple gave us the "pcast://" and ".pcast" duopoly for podcasts into iTunes. The interesting thing here, is the .pcast file on Windows is better than what they offer (well supported anyway) with the pcast:// URLs on the Mac, since I can put a .pcast file on an https:// server, and embed a link to an https:// server in the file. There is no pcasts:// protocol definition. Simply using pcast:https:// would have worked just fine, but nobody seemed to want to stop and think about that.
It is not as though people in the Java world are unaccustomed to long URI schemes. I can't count the number of times I have put jdbc:oracle:thin: into a text file, but hey, unlike jdbc:mysql: oracle has 2 underlying access methods, so they add another layer. Just seems like using ..ws: as the last part of that URI is like restricting jdbc: to one sub-schema. In the best of all possible worlds, shouldn't it just be specific enough to indicate that "I pass the rest of this to JAX-WS" and move forward, letting JAX-WS take care of the next protocol level with whatever it's native or available support method is?
Are they URIs? Do they all comply with RFC3986?
Oh, and don't get me started on the complete foolishness of