Rough Edges of .NET

Looking around the .NET Framework, I am impressed by what is there already and the amount of effort need to build such a framework.  Great deal of .NET is familiar because its design has been influenced by and stolen from Java.  There is no shame in stealing good designs IMHO.  There are some innovations as well which I am sure Sun will return the favor with by incorporating into Java.  If innovation is the butter of technology, mimicking is the bread.

However, there are some curious holes in .NET like the System.Data classes which I feels is superior to JDBC in some respect yet lacks built-in data provider abstraction classes.  To use a data source, one has to instantiate data provider specific classes like SqlConnection, OdbcConnection, or OracleConnection.

While one could write their own abstraction layer, most .NET programs I have seen chose to be hardwired to specific data provider implementation (typically Microsoft SQL Server).  Given that huge amount of design efforts went into .NET, it's a complete mystery to me why they ignored this obvious shortcoming.

BTW, if you want to avoid hardwiring your program to specific data providers, you might want to look at Brian Ritchie's data provider abstraction layer which he contributed to the Mono project.  I would have designed it a little differently and went a little further like abstracting data provider specific exception classes, but it's good enough to get you started.

ASP.NET Weekend

It's Friday again and a weekend of tinkering is about to start.  This weekend its ASP.NET.  For a Java programmer, programming in .NET is like a being dropped into a parallel universe where similarities breeds confusion.  Imagine the mental state of a man who straddles two parallel universes and you got a good picture of an engineer who programs both in Java and in .NET.  Onward!

Tomcat 5 and Remote Desktop

Tomcat 5.0.16, first stable release of next generation Tomcat engine, is out.  Woohoo!

I have been using Remote Desktop Connection for Windows Server 2003 and I am hooked.  In comparison, remotely managing Linux servers through SSH console is swiming in mud.  I particularly love the ability to access local drives and devices from the remote server desktop.  No more SFTP sessions.  To copy some files, I just drag and drop from local folder to remote folder.

Atom-Syntax Sin Tax

Based on ongoing discussion in the atom-syntax mailing list over my Making Atom Happen proposal, most of them are not even taking the proposal seriously.  One even called it trolling.  Hogwash.  If you are doing something that affects my life, I have the right to do something about it.

So it looks like all of us are going to pay for their pride and esthetic obsession: a sin tax over the syntax fetish.  If you want to do something about it, go to the JustSayNoToAtomFeed page at Atom Wiki and add your voice of support.  If we are going to be ignored anyway, lets get ignored blatantly.  It doesn't matter if you are a developer or a user, you'll be taxed so you have a say.

Making Atom Happen

As I commented on Scoble's post, I believe the Atom initiative is dead in the water despite apparent signs of Google adoption.  That is too bad because the real strength of the initiative is the list of people and companies who have pledged support for the initiative.  As Scoble pointed out, if Google adopts Atom then Microsoft will have to support at least two feed formats and this raises the question of "Why not Microsoft's own format?"  We are heading down the wrong road.

IMHO, the most practical path out of this mess is for the Atom initiative to hi-jack RSS 2.0 and build on it without breaking backward compatibility.  A new spec will obviously have to be written to avoid copyright problems with Dave's version of the RSS 2.0 spec, but people were complaining about the old spec anyway.

As to the Atom API, I won't bitch about it any more if RSS 2.0 is adopted as the core Atom feed format because the feed format is far more important than the API.  This should satisfy Evan Williams since his real beef is with the API.  Yes, there are some issues people have with RSS 2.0 but they can be ignored or worked-around with extensions until later, hopefully much later.

The best part of this solution is that everyone will feel like they got screwed.

How BitTorrent Works

BitTorrent can be difficult to understand so I'll try to explain how it works.  Let me know if there are any mistakes.

BitTorrent is NOT Napster

BitTorrent is not a file sharing technology.  It's a download sharing technology.  With BitTorrent, you share with others what you are downloading while you are downloading.

What is a Torrent?

A torrent is just a web resource served by a web server and accessible by a URL.  Usually a torrent maps to a file or a folder of files.  Link to a torrent can be published and shared like other links so torrents are blogosphere-friendly.

How do I download a Torrent?

To download a torrent, you need to install a BitTorrent client that will run when a torrent link is clicked on.  Note that there is no need to launch the client explicitly so don't be surprised if there is nothing to launch after installing the client.

While Downloading a Torrent…

As mentioned above, clicking on a torrent link will cause the BitTorrent client to start downloading the torrent.  Torrent-enabled web server keeps track of the downloaders and refer them to each other so they can share what they downloaded so far.  If there is just one downloader, there is no one to share with so it's just regular file download.

If there are many downloaders, some of the downloaders will have parts others don't and could share those parts with others.  This reduces load on the web server and allows it to handle large number of downloaders easily.  Bandwidth saving also means a shocking ISP bill won't wipe the slashdotted smile off your face at the end of the month.

Corrupted Torrent?

While a torrent is being downloaded, some (all?) BitTorrent clients will scramble the content for reasons I am not sure of.  If there are more than one file in a torrent, all the downloaded files will be scrambled until all the files are downloaded completely.

Where Do I Find Torrents?

Websites, blogs, and Google.  There is no central directory like Napster.

In my opinion, flash flood nature of blogs will be well served by BitTorrent.  Likewise, link-happy nature of blogs will complement BitTorrent well.  Ultimately, I think a tailored variation of BitTorrent should be built into blog clients and servers for download sharing of feeds, images, enclosures, and other blog-related resources.  BitTorrent will encourage media-rich blog posts without applying power-law to the bloggers' wallet.  BitTorrent means blog torrents.

BlogStAX: Using StAX to Parse RSS 2.0

Last night, I wrapped up the first release of my RSS 2.0 parser using the StAX API.  It's tentative name is BlogStAX and you can download it from the BlogStAX page.  Beside the obvious speed, you might find its design rather interesting.  While it is definitely not a turkey, consider this my Thanksgiving present to the open source community. 🙂

FYI, BlogStAX doesn't validate RSS feeds.  It used to validate and report the errors via the RSSValidationListener interface, but I ripped it out because validation checks were not complete.

OCSP Weekend

While my wife and son are visiting the San Francisco Zoo with my son's cubscout den, I am at home putting together an OCSP object viewer.  Here is a snapshot of what I got so far.

It's showing an OCSP response data which is DER-encoded.  The grid is actually a tree view control with multiple columns.  I'll have to whip up some icons for different types of ASN.1 objects though.  I am using OpenSSL to parse the data but it's just too heavy and console-oriented for my purpose.  When I have more time, I'll turn it into a generic ASN.1 viewer.

Packaging OCSP Responses

Is there a standard format for packaging multiple OCSP (Open Certificate Status Protocol) responses into a single file/stream?  A digitial signature validation could result in multiple OCSP responses and letting users deal with multiple DER files is too awkward from usability point of view.

For now, I am thinking of storing multiple BASE64-encoded OCSP responses in a XML file.  Properly designed, the XML format should be able to store other information related a valdiation session such as OCSP requests, signature itself, implementation bits, etc.  This way it can be used as a general log of a validation session which can be used as a proof of validation.

Also I have noticed that, although there are many tools and software for OCSP developers, there aren't many tools for users.  For example, a simple GUI-based OCSP response viewer could be pretty handy.  An embeddable version would be even better so I can use it to build a viewer for the 'OCSP Log' file I mentioned above.