A small idea about java API for URI
The contest seems very interesting, but I don't know whether I can make a complete proposal. Here is just my story and my idea. Last weekend I was writing my own URI implementation in JavaScript because there is no standard library in JS. (Oh, I'm a web developer not a pure Java guy :) I need to design an API for my URI class, so as usual, I use java API for reference. After one day hard work, I finished a clone of java.net.URI class in JavaScript. But I noticed that the documentation of java.net.URI says there are some deviations from the spec so I decide to read the spec (RFC2396) to check it. To my surprise, I found RFC2396 has been obsoleted by a new standard: RFC3986. It introduces many changes, for example, it doesn't use terms "scheme-specific-part", "opaque URI" any more; the definition of "absolute URI" has been changed (or clarified); some markers (such as ! *) have been moved from unreserved category to reserved category; it also include the clarification of empty path, relative reference, the resolution of the URI reference...All those improvements make java.net.URI outdated and not standard-compliant. The API for URI should be redesigned according to the latest standards, we may introduce a new URI class and mark the old java.net.URI deprecated. We also need some subclasses of URI for normal schemes, such as URN, HttpURI, FtpURI, FileURI...for scheme-specific operations (for example, it will introduce extra rules for equality and normalization), and AbstractURI class for building a new scheme. It also be very nice to implement a superset of URI, that is IRI, as RFC3987. (The docs of .NET System.Uri class says it implements the IRI within Uri class.) Finally, because URIs are just identifiers, and it has been the infrastructure of the most systems, so it may be not proper to put URI classes in java.net package. I think it should be java.util.URI. So, that's my small idea, redesign and implement URI/IRI classes, move them to java.util package and mark the old java.net.URI deprecated.
participants (1)
-
John Hax