Wednesday, June 20, 2007
I've just created a new project on CodePlex, and it's got the first (and hopefully only) release available. Enjoy UriTemplate.
Some background whining...
I admit that sometimes I get a little jealous of other developers, who are not as limited in the things they can adopt. In some cases its a cool new idea like doing RESTful applications. In other cases its a bit of nice functionality living in another platform like java. In still more cases I'm lusting after the cool new stuff in various Microsoft .Net CTPs, betas and such.
The real-life world I find myself in, though, often has me coding against legacy systems running on ASP.Net 1.1, on servers I cannot control or upgrade with inherited systems that barely grok the idea that
WebControls can have properties. Woe is me, and probably many others of you out there.
Today, however, I'm taking back the future for slobs like me, and I'm doing it one class at a time.
Enter the idea of fire...
A while back, I was reading Steve Maine's excellent blog and found the interesting post UriTemplate 101, which talks all about a new class available in an upcoming release of .Net. The basic idea of this class is to let you specify a pattern of replaceable tokens to use when constructing or parsing URIs. The class looks to be quite nice, but being a future released, I just filed it away for later cogitation.
A log in the fireplace...
Dare and everyone else have been talking about this wonderful RESTful world forever, where everything is about URIs that mean something and state transitions occur by following those meaningful paths. Couple that with the long standing best-practice of building Web systems with "hackable URLs" . This resonates with me, and I start thinking about UriTemplate as the application. Of course I don't have any new stuff I'm building that would let me play that way... until last week.
A match could start something...
Suddenly, a new project appears on the near horizon... a chance to retrofit an cool new set of functionality to an existing ASP.Net 1.1 site. This new stuff would really benefit from hackable URLs and thus needs a good URL Rewriter and Virtual path handler. Sure, those exist, but almost all force me to map URLs to pages via some lovely RegEx matching. This project, however, is all content-driven and just cries out REST. I want a more general solution and UriTemplate sounds like a match.
Fanning the flames...
So, off I go, looking for the DLL for UriTemplate that Steve's talked about for "investigation". I spin and whirl and Google and Live Search (not a verbable word!) till I'm blue in the face, but I can't figure out where this wonderful class has even been sneaked out for peek. In fact, none the searches turn up much more than Joe Gregorio's original idea posting as a follow up to the application to RESTful development of templated URIs.
Eventually, I stumble across Jeff Newsom's curiously titled posting about some upcoming WCF features that shows using a UriTemplate in a WebInvokeAttribute. He also mentions in another post that some functionality was "folded into the BizTalk Services SDK", which brings me right back to the start with Steve Maine's blog. So, I now know where to look. A quick download of the BizTalk Services SDK and I've got some code to look at. Fire up Reflector and ugh...way to complex for me to use since I can't deploy the SDK to my production environment. I guess I'm going to have to write my own, but I'm sure not going to back port the one in the SDK.
I breathe some life into it...
So, last Friday, I finally got around to deciding it was time to just write the code myself, I did another search based on the links that I previously found and stumbled across James Snells posting about draft specification for URI Templates, which included a Java implementation. This code is simple and clean... very likeable. Too bad it's in the wrong language and built for the wrong platform. But I know Java, I know C# and I know how to make one look like the other. A short time later and I've got a fully functional .Net 2.0 version of the package that James wrote.
This week, my coworker Ryan Stephenson did a quick back-port to the .Net 1.1 framework (I told you we had deployment restrictions!) and today I bundled it all up, created a project on CodePlex and made a quick home page for it.
Bask in the glow...
So, like I said way back up there... there's now a perfectly serviceable UriTemplate implemention available for schmucks like me. If you are interested, the goods are here.
Saturday, June 16, 2007
The new release adds some awesome features that many users have be asking for, some considerable tightening of the code base was done by myself and Jon Gallant, and I got off my lazy butt and update the Wiki using some documentation that Piyush wrote as a basis.
This release adds support for some huge features that I'll summarize here, but you should really head to the project home page to read the Wiki documentation.
- Atom, RDF and OPML support! Available both for consuming and publishing, this includes full support for the required elements of the various RSS, Atom and RDF schemas. For OMPL feeds, supports aggregation of the referenced feeds (even if mixed format) into a single feed.
- Strong-typed code generation of classes that fully understand the feed schema, including any custom extensions like the Yahoo Media RSS extensions.
- RSS/Atom/RDF schema validation during aggregation of OPML
- Ability to reflect or generate any feed in any of the formats supported (including pulling Atom feeds in and morph to RSS out).
- DownloadManager can be used to cache any feed format and supports app-relative paths under ASP.Net applications
- Added support for enclosures and qualified namespaces for feed elements
- Now packaged as a Visual Studio solution with proper projects for all the sub-projects
- Sporting a new complete set of Visual Studio Team unit tests (sorry, nUnit guys... haven't created parallel ones yet)
See this post for details on the earlier version 1.0 releases
Thursday, June 14, 2007
Anyone who has been bitten when going from SQL Server 2000 to SQL Server 2005 due to the (intentional) decision by Microsoft to ignore the ORDER BY in a VIEW that returns the entire result set can now get a HotFix to enable the legacy behavior. After installing the HotFix, you will also have to turn on traceflag 168.
Monday, June 11, 2007
Recent research shows that including a scientific explanation of psychological phenomena increases people's acceptance of the explanation. This holds true even when the "science" is irrelevant. I suspect this extends to other explanations in other areas. Would you be more likely to accept a web-standard when backed with lots of numbers that you don't really (take time to) understand?
[via: Language Log]