Widget Rewrites

I started the daunting task of rewriting my DHTML widgets to include (among other things) XML support. When I'm done, widgets will be able to instance and populate themselves according to the data contained in XML files. That means little to no coding will be required to use them, which I think is pretty friggin spiffy.

The first to undergo the overhaul is the MouseMenu. I was not looking forward to revamping this widget mainly because it was the first widget I ever created. Is it obvious or what!? It is amazing to see how much our skills grow. The current version is 2.4.5 with around 428 lines of code and is 18KB on the file system. It's also a pain to read, a pain to follow, and there's some hacky stuff going on (Hey, I did the best I could!). The new version (version 3) has the exact same functionality and is sitting at 322 lines and 11KB filesize. It is also much easier to read and follow, and the whole thing is object oriented (even more so than version 2). I use objects everywhere.

I expected the rewrite to be quite a bit more work. In fact, I told Foo today that I expected the code size to be at least double (if not triple) the current size. Heh, I was wrong. Foo, the "theory" has been proven to be true.

There is a downside, however. With every rewrite, changes are made. In this instance (and in the instance of all the widgets), the syntax has changed. I'm following conventions that I use in C#. This isn't an issue when using XML, but it is when instancing and populating the system using the API. Ooops, sorry.

I expect to be finished on the MouseMenu sometime this weekend. I'm not yet sure on how I want to implement XML support; I also need to change the online documentation to relfect the new script. It'll all be worth it, though; at least in my eyes.
7/15/2004 12:00:00 AM | Tags:
© 2008 Jeremy McPeak