Extensibility vs. Ease of Use

Jesse Ezell has a post where he criticizes my recent entry on Tight Coupling vs. Loose Coupling. He seems to have drawn the same conclusions I did about Interfaces vs. Abstract classes when it comes to versioning APIs then asks why using an API based on abstract classes that represent an RSS item isn't better than passing around IXPathNavigable objects. He correctly points out that an API based on objects is easier to code against than one based on passing around XML. However, the goal of passing around XML instead of objects is flexibility and not necessarily an easier programming model.

One of the problems with using an object model instead of passing along data is the complexity inherrent in trying to represent a constantly evolving yet decentralized data format like RSS using rigid object structures. In the post entitled How Not To Build An Extensible Interface post I point out the fact none of the APIs proposed even deals with exposing all the elements of the core RSS spec let alone extensions like Dublin Core, the Comment API or Easy News Topics.

To expose all data to plugins one either has to figure out how to expose the semi-structured XML data via the object interfaces (hashtables of key value pairs, XmlNode objects, etc) or provide limited interfaces as Simon and now Jesse are proposing. So far, XML has proved to be the mechanism of choice for exposing semi-structured data and if one is going to expose part of the data as XML then one might as well expose all the data as XML.

The current application of RSS Bandit uses an internal RssItem object which exposes the most frequently accessed data in an RSS item as properties (even though many of these are often absent in feeds such as description, date or title). However I've realized the value of exposing all the data in the item as XML especially for enabling flexibility and decoupling the application from user plugins or other extension mechanisms. For instance, providing XML views of the RssItem object means that I can allow people to swap out the stylesheet used to display the RSS item in the browser pane with ease.

The primary problem I have with Jesse's solution is that it makes plugins beholden to the application for supporting a new RSS feature because even with abstract classes the concrete implementation that is passed around still needs to be defined by the application. On the other hand, when passing XML around users can be using version 1.0 of the aggregator and yet only have to upgrade their various plugins to obtain support for new RSS features. Jesse's approach ties plugins to specific versions of an aggregator while using XML does not. Guess which one I prefer.

#

Winforms and the Magic Library

In a previous diary Skywise asked why the widgets shipped in various Microsoft devloper toolkits lag behind third party technologies like the Magic library. As is typical when someone complains about a Microsoft technology there was a quick reply that Microsoft does this for nefarious reasons.

Of course, if you think about it this doesn't make sense. B0rg central has nothing to lose and a lot to gain by providing developers with cool technologies for developing kick ass applications. Being the pest that I am I decided to take the issue up with our resident Winforms PM, Mike Harsh, who stated that the limitations of the Winforms GUI toolkit in v1.0 of the .NET framework were due to scheduling constraints (which I now know about all too well) and they plan to rectify this in future releases. He mentioned that he may be blogging about their proposed improvements in future.

#

Look Who's Blogging Now

I just found out that Kimbro Staken is blogging again, subscribed.

#

Hannibal the Gangsta Cannibal

Stories that make you go WTF:
An aspiring rap star who has been charged with murdering his roommate and eating part of her lung did so as part of his record label's plan to cultivate a "gangsta" image for him, the victim's mother charged in a lawsuit filed in Los Angeles
Dang, what happened to traditional means of proving how much of a thug you are like getting shot and living to rap about it?

#

RSS Bandit Prevents System ShutDown

A few people have complained that when running RSS Bandit on a Win2K box attempts to shutdown or reboot the computer are prevented from completing. Best I could tell is that in the Closing event setting the event's Cancel property to True keeps even the system from being able to close the program so that it can't reboot until the application is manually closed.

This problem should be fixed in v1.1 of the .NET Framework which is available now. However if you are tied to v1.0 of the .NET Framework the code below is a workaround
enum WM

                {

                        WM_CLOSE            = 0x0010,

                        WM_QUERYENDSESSION  = 0x0011,

                        WM_ENDSESSION       = 0x0016

                }

protected override void WndProc(

        ref System.Windows.Forms.Message m)

{

  if (m.Msg == (int)WM.WM_CLOSE ||

          m.Msg == (int)WM.WM_QUERYENDSESSION ||

          m.Msg == (int)WM.WM_ENDSESSION)

        {

    RssBanditView. Closing -= new
      System.ComponentModel.CancelEventHandler(

        RssBanditView_Closing);

    base.WndProc(ref m);

          RssBanditView. Closing += new
      System.ComponentModel.CancelEventHandler(

        RssBanditView_Closing);

        }

        else

        {

                base.WndProc(ref m);

        }

}   
Shoutouts to Zhanbo from the Windows Media team for providing this info.

#

South Park

Cartman Jennifer Lopez quote:
Don't be fooled by all my money
I still like to eat Tacos, honey
It's a lot funnier with some context

#


--
Get yourself a News Aggregator and subscribe to my RSSfeed

Disclaimer: The above comments do not represent the thoughts, intentions, plans or strategies of my employer. They are solely my opinion.
 

Categories: