Welcome to EMC Consulting Blogs Sign in | Join | Help

Richard Griffin's Blog

Del.icio.us Silverlight Library, Tag Clouds and Dependency Injection

Last year I built a couple of WPF tag cloud applications that hooked up to my del.icio.us account and displayed the data using different visualisations whichtagcloud included a tag cloud in a variety of different flavours and I also used the Time Line Panel from the blendables control suite from Identity Mine. To access del.icio.us I used a .net library up on Source Forge originally developed for use in the del.icio.us Winforms client called Netlicious which was originally written for .net 2.0 by Nate Zobrist. After playing with Wordle I revisited the WPF applications and start to wonder how I build a similar application in Silverlight.

The first challenge was to rebuild the del.icio.us library to provide a mechanism that would allow the Silverlight client to retrieve content from my account. It would be cool to see a LINQ to del.icio.us library at some point. After looking through the existing library I decided that to rewrite the library and take advantage of the 3.5 goodness which has been added since the 2.0 release. I also wanted to change the architecture slightly so that the library used Interfaces and roll in Ninject at the same time. Ninject is a very cool DI library from Nate Kohari which does exactly what it says on the tin with not a sniff of Xml configuration insight. Using the Netlicious as a reference point I rebuilt the library rather quickly, there are still some modifications to make, more unit tests to write and also the mocks to finish off but all the pieces are in place ready to be completed.

With the library now in place I started to build the Silverlight Client, when you use Ninject or unity in your Silverlight application you will start to create a Presenter View style pattern that takes advantage of a service locator class in your client and the results are all very impressive, Jonas has a great example and talks more about using Silverlight and Ninject here. The main advantage of this approach is the pure separation of concerns from the Xaml Views, all the work is done in the View Model classes which can be isolated and tested easily using the Silverlight Testing templates. Jeff Wilcox is the chap with his finger on the pulse so if your interested or want the latest templates head over to his blog.

After creating the views, view models and required bits for Ninject to work, I rolled in Dev Dave's Animated Wrap Panel to allow for a tag cloud look and feel to the application. In the original WPF applications I used a Converter to change the size of the font however this changed when I rolled in the Animated Wrap Panel, the converter is still part of the project just in case you want to try it out.  With the Animated Wrap Panel in all that was left to do was create the web site and a WCF service call to deal the cross domain calls and also to provide credentials so that we can access the account on del.icio.us.

Future enhancements that I have in mind include; a richer client that takes advantage of Silverlight's persistence storage; adding the ability to search tags and posts; creating a Posts control so that the user can select a tag and view related posts; and also adding support for Bundles in the client. You can get the current drop of the del.icio.us Silverlight library and the current Silverlight application from my SkyDrive. If you are interested in helping out with building the del.icio.us client or you have some cool design ideas for the client please add a comment or drop me an email.

Published Thursday, August 07, 2008 5:00 PM by Anonymous
New Comments to this post are disabled
Powered by Community Server (Personal Edition), by Telligent Systems