p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Silverlight 1.0 ISBN 978-0-470-22840-1 (http://p2p.wrox.com/forumdisplay.php?f=369)
-   -   Is Silverlight / ASP.NET really THIS Complex? (http://p2p.wrox.com/showthread.php?t=64389)

Gary Frank December 6th, 2007 03:43 PM

Is Silverlight / ASP.NET really THIS Complex?
I've just about gone through chapter 5 where the authors tell us how to use Silverlight with an ASP.NET program. It is very surprising to me that it is involves so many different pieces, and that it is so difficult and complicated! The extra code that you add to your web programs makes the whole project much larger and harder to understand and maintain. Did Microsoft really come up with a tool that requires such an effort to integrate with ASP.NET?

I would be interested in finding out your reaction to this.

Ambrose December 6th, 2007 05:57 PM

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 (http://www.asp.net/downloads/futures/) 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

Gary Frank December 7th, 2007 01:24 PM

Thanks for explaining your perspective on this, Ambrose. As I think of it now, all of the complicated code goes into building the controls, and then the controls are used by ASP.NET. So that should separate the added complexity from the other web pages, which will keep things maintainable. And it should also allow the program to be more cleanly upgraded when VS 2008 and Silverlight 1.1 become standard releases.

I guess I should also realize that Silverlight 1.1 and future upgrades will be integrated into Visual Studio, and a lightweight version of the CLR will become a plug-in. I would guess that will put the Silverlight controls on equal footing with ASP.NET server-side controls and it will become just a matter of dropping a Silverlight control onto the web page, sort of like how they are evolving AJAX. Therefore it won't increase complexity. The point of this book is for people like me who want to use it with VS2005 right now.

I picked up Microsoft's "Introducing Silverlight 1.0" yesterday in order to get the overlap between the 2 books. It's interesting that their section on ASP.NET is only 13 pages long. They use web services. Did you guys ever do that? I'd guess that their approach can't do what yours does, or else you preferred this control approach to their approach.

Anyway, at this point I need to start coding in order to get some feedback and a better understanding of this stuff. I'm sure some of my comments reflect that! BTW, hope you had good luck deer hunting last week.

Ambrose December 7th, 2007 06:46 PM

Hi Gary,

Absolutely we used Web services. Check out the sample app Lumos; we have both a 1.0 and a 1.1 (now known as 2.0) version w/ the online chapter.

I guess I don't think of Web services as synonymous with ASP.NET. In fact, with WCF, they're really not at all. I tend to think of ASP.NET more as Web forms, controls, and so forth--the GUI aspects, though of course you can validly argue it includes more.

Glad to hear the other book compliments this one. It's a shame when everyone does the same thing; reduces the level of combined knowledge. :D

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

All times are GMT -4. The time now is 01:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.