View Single Post
  #2 (permalink)  
Old December 6th, 2007, 05:57 PM
Ambrose Ambrose is offline
Wrox Author
Join Date: Oct 2007
Location: Princeton, NJ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Gary,

I'd suggest that Microsoft often covers the simple/easy scenarios very well. But the problem tends to be that either the scenarios covered (made easy) don't meet your needs or that if you just take the "easy" route, you end up with a monster in the end.

In context of Silverlight, for example, as noted in Ch5, MS is doing a Media control, which is the #1 scenario for SL 1.0. It will be full-featured and will make it easy to embed SL media player in your ASP.NET apps. Similarly, the Xaml control will make it easy enough to just embed arbitrary XAML into your page, and this will be sufficient for some scenarios. Unfortunately, those have yet to be released, so we didn't want to rely on them, although we did make an effort to maintain public API and feature parity as it stood when the example code was written.

But even in basic scenarios that the MS controls meet, if you use them a lot and don't take the effort to design or at least refactor your code into custom controls, you could gradually end up with something that is very difficult to maintain and brittle (resistant to change). So while not everyone needs to write custom controls with ASP.NET (or ASP.NET AJAX), I caution devs in general about taking the easy way out because it usually causes more pain in the long run.

Now, if you want, you could just grab the Ch5 sample code and use the Xaml control there to quickly and easily embed Xaml into your app--you don't have to write a custom control. Or you can grab the latest ASP.NET 3.5 Extensions futures release ( and use the MS Xaml and/or Media control (note: they're going to release an update very soon). Using any of these will be just like using regular ASP.NET server controls, so there isn't a lot to learn for folks who are ASP.NET devs--just use those controls and apply the knowledge gained from the rest of the book on how to build Silverlight 1.0 stuff and you're there.

Ch 5 focuses in on the additional knowledge ASP.NET devs need to take Silverlight 1.0 usage to the next (pro) level. If you don't need that, then just use the provided server controls, create a XAML file, and add JS to your page to automate it as needed. If you want to follow general coding best practices, consider doing what's in Ch 5.

But I do take your point. We could have had a small section explaining this before diving into the custom control stuff. But I will share with you that the absolute best way to really learn ASP.NET is to dive into creating custom controls; there is nothing like it to really get a firm grasp of the platform. Similarly, Ch5 gives you that same level of advanced learning that should enable you to handle both the simple and the complex ASP.NET+SL1.0 scenarios with more competence.

Hope this helps.

J. Ambrose Little
Co-Author of Pro ADO.NET 2, ASP.NET 2.0 MVP Hacks, and Silverlight 1.0
UXG Group Lead at Infragistics