Tip of the Day: How To Answer: Will This Work In Silverlight 2.0?

I'm beginning to receive a lot of email about what is coming in Silverlight 2.0. Today's was pretty typical, so I thought I'd post the questions and answers (without revealing anything specific about this writer's application), as  a guide to the kind of response you can expect.  (Published early today to get an answer to this reader!)

Please note, the best place for this kind of question is our Forum, where you'll get a far faster and more comprehensive answer; but I do understand why some folks write directly.

Here is the (slightly edited) letter with my response

I am the architect [responsible for redoing the UI of a large calculator/spreadsheet that is now in ASP.NET and that goes back to the server for all its calculations. I'd like to consider Silverlight rather than AJAX to move the calculations to the client, with the main benefit being managed code]…

If we rebuild the application in Silverlight (assuming 2.0 with a 2009 go live) would we be able to use the existing c# libraries built out for validation and calculation without reworking them? … plug-in and [access our rules on the client. This would eliminate a lot of round trips and network traffic.]

I want to give you all the information I can, but for the moment I have to give you somewhat  less information than will be available once we release Silverlight 2, which we will do very soon. The release date remains 1st Quarter of this year for Beta 1 (that is, no later than March 31). I'm willing to go out on a limb and say we're working hard to come in a bit early.

So I'm going to ask that you re-send this question to me after we release, if that is okay. In the meantime, I’ll do some research to see if I’m at Liberty™ to say more.

The specifics of what will be in Silverlight 2 has not been announced, though some general guidelines have been written about here.  We have said, for example, that we’ll support C#, and that we’ll support a significant subset of the CLR.

Let's assume we wanted to get something done ….today  [using Silverlight 1.0 for now] Could I put a hidden Silverlight component on the page that encapsulates the c# libraries from the server? Then I could simply swap out the Ajax post-backs on each existing field for a js call to the Silverlight engine and update the fields accordingly.

You could certainly create a hidden Silverlight 1.0 control on your page.  It  in turn, could certainly interact with a web service and/or do work on the client side. And further, you could later swap this out and replace it with a more powerful Silverlight 2 control. 

On the other hand, I'm not convinced this is a big win; because by the time you have your 1.0 component working 2.0 will be ready and they will work quite differently.  For example, Scott's blog entry notes that Silverlight 2 will support "two-way data-binding support" –

I don't think I'm giving away anything to say that we'll have extensive data support; I'd hate to see you build an infrastructure only to throw it away. Frankly, I think it would be a bigger "win" to spend your time, for example, reading chapter 5 in Programming WPF — while the details in Silverlight 2 may be slightly different, Silverlight 2 is so closely related this will be time very well spent. See this Tip of the Day for more.

As a side question, if all I was doing was building a rules/calculator engine in Silverlight I would assume that all things being equal it would run faster and have a smaller bandwidth footprint than an equivalent js class. Is this the case?

There is no question that if you build such an engine in C# vs. .js it will be smaller and far faster.

So basically, am I on the correct track with this? I don't want to misuse the new Silverlight technology as my predecessor did when they misused Ajax.

Sounds to me like you are very much on track. AJAX is great, and has all sorts of advantages, but you seem to value performance very highly and Silverlight 2.0's huge advantage for you will be the ability to code with C# and the CLR.

I can assure you that as we announce Silverlight 2.0 we’ll be providing a great deal of documentation and support through Silverlight.net I wish I could say more today; I’m not trying to be coy; but we want to make sure that we deliver on what we say and we do so with a unified and coherent voice. That will be very soon.

If I learn more about your specific questions, I will certainly send you a private email. In the meantime, thanks for your patience.


A side note to readers of Tip of the Day: Due to circumstances, Tip of the Day will be spotty for a while; probably off the air for a few days, and less frequent than I'd like leading up to Mix. I promise to make it up by a huge outpouring of Tips starting after my incredibly ill-timed vacation ends  on March 18. At that point, you can expect no fewer than 5 Tips of the Day per week through the summer.

Share

About Jesse Liberty

Jesse Liberty is an independent consultant and programmer with three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP, Microsoft MVP and Telerik MVP.
This entry was posted in z Silverlight Archives and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.