How to build a widget – Choose the technology

December 6th, 2008 by Tom Sprows Leave a reply »

[Part 2 in a 5 part series titled “How to build a widget]

Widgets in reality are actually like little mini-web sites contained on a users blog/social page.  The “embedded chunk” of code is hosted by the widget owner (you) but instead of just displayed on one location (your website), the widget is displayed virally on an infinite number if websites.

This “embedded chunk” requires some specialized tech to pull this off.

2)  Choose the technology

There are basically two categories of technologies used to create widgets:  HTML/JavaScript and third-party plug-ins.

HTML/JavaScript

A widget developer could craft the entire widget using HTML/JavaScript.  With the combination of AJAX and DHTML a developer can create at least 4 of the 5 categories of widgets (I am going to leave out the “Games” category since advanced animation is tough to deliver in a JavaScript environment. Agree/disagree?)  

HTML/JavaScript only relies on the browser to render the widget, making it the purest way to craft a web widget. 

Pros:
- JavaScript can encapsulate the “embedded chunk” of code to a small snippet.
- HTML/JavaScript is a coding common paradigm known by many web developers.

Cons:
- Many social sites forbid JavaScript since it could promote cross-scripting attacks.
- Animations and other rich content are very hard or impossible to reproduce using JavaScript.
- The HTML/JavaScript code could be seen by site visitors.

Third Party plug-ins

The other common source of widget development takes place as third party plug-ins.  The most popular third party widget platform is Adobe’s Flash. Flash allows the developer to create rich environments and user interfaces using their designer and ActionScript programming language.  Flash debuted as a third party technology in 1996 and has over 90% browser saturation.

Adobe Flash

Adobe Flash

 
Another third party widget platform gaining ground is Microsoft’s Silverlight.  Silverlight allows you to create rich environments and user interfaces using MS .NET platform.  Silverlight broke onto the scene in Dec 2006.

Flash still has more popularity as a widget platform due to its tenured status, but given the sheer volume of .NET programmers it may not be long before we see Silverlight as popular in widget development as Flash.

Pros:
- Flash is accepted by almost all blogs/social pages.
- Rich content and animation is very possible in Flash/Silverlight.
- Flash/Silverlight is much more locked down in terms of code visibility.
- Widget distribution sites generally favor Flash over JavaScript/HTML

Cons:
- Flash requires you to purchase Adobe’s Flash product to develop widgets.
– Learning .NET/ActionScript.
- Flash/Silverlight widgets are generally larger then HTML/JavaScript widgets in terms of download size.

When I was developing MyVGift.com Virtual gift widget I chose to use Flash for two reasons:  One, I wanted it to be able to be deployed on as many blog/social pages as possible (This ruled out HTML/Javascript).  Two, Flash is much more available (at present) then Silverlight.

I would like to possibly write my next widget using Silverlight since I have been working with programming Microsoft software for the last 14 years.  I strongly believe that Silverlight will play a major part in having widgets grow across the web in the coming years.

So if you are just writing a widget that is targeting Blog sites, HTML/JavaScript may be a good choice.  If your widget relies heavily on animation and you want it to have a wider reach, then Flash/Silverlight may be the option.

Next – Part 3 – Creating the widget.

Part 1 | Part 2 | Part 3 | Part 4 | Part 5

8 comments

  1. Todd Havens says:

    I’m really enjoying the widget series here, Tom, so thanks!

    I can’t speak to any of your technical questions (animation via Javascript), but will just add that I upgraded my Mac earlier this year and it already had Flash on it…so I cracked some books, Google’d like a madman with every question I had and built myself a widget. It was a lot of fun!

  2. Tom says:

    Thanks for the comment Todd. Look for Part III in a couple of days 🙂

  3. Avatar says:

    I would love it if you could also do a series of post when you get to build your first Silverlight Widget.

    I have not been able to actually Review your Widget. but it reminds me a little bit of the ZuneCard Widget. i would like it a lot if it would work the same way so it would do more in the very same space. maybe you have never seen it. but i will also be reviewing that soon enough if you haven`t seen it.

  4. David says:

    Where are the other parts?!?

  5. Avatar says:

    hopefully one or two parts more will be posted before the year ends. but i will ask the guest author what is up with the other posts.

Leave a Reply

Website maintained by Happy Shoe Media LLC