Silverlight Hack

Silverlight & related .NET technologies

About Me

Welcome to Silverlighthack.com.  This is a site where you can find many articles on Silverlight, Windows Phone 7 and .NET related technologies.  

My name is Bart Czernicki.  I have been working with computers since 1988 and have over 12 professional years in the IT field focusing on architecture, technology strategy and product management.  I currently work as a Sr. Software Architect at a large software development company.

Below is the cover of my new book that shows how Silverlight's unique RIA features can be applied to create next-generation business intelligence (BI 2.0) applications.

Silverlight 4 Business Intelligence Soft 

Contact: bartczernicki@gmail.com

View Bart Czernickis profile on LinkedIn

NONE of the comments or opinions expressed here should be considered ofmy past or current employer(s).  The code provided is as-is without anyguarantees or warranties.

Silverlight & ASP.NET MVC vs Web Forms (Very High Level)

Silverlight 2 RTW has been out for a couple of weeks now and it is already being compared to ASP.NET MVC which is an evolutionary way to design web applications using ASP.NET.  I read a concise summary (pros and cons) of ASP.NET MVC from Jason Young.  His article can be read here: http://www.ytechie.com/2008/10/aspnet-mvc-pros-and-cons.html

I decided to compare Silverlight in a similar way to what Jason did when he compared ASP.NET MVC vs. Web Forms.

Here are the items he listed as ASP.NET MVC vs. Web Form:

PROs vs. ASP.NET Web Forms

  1. No ViewState or "surprise crap"
    • This applies to Silverlight as well.  Silverlight brings the "desktop" experience to the end user and there is no ViewState that is used in Silverlight.
  2. Faster server-side & client-side
    • Silverlight is faster on the client/server side depending on how you look at it.  Silverlight is compiled in a .NET subsystem of Silverlight.  You have access to multithreading, LINQ, complex data structures, etc.  The performance vs. an ASP.NET or AJAX/JavaScript application is it magnitudes times better because of the client execution and some of the items that normally are handled in a server BLL can be brought down to the client
  3. Simplified model for multiple related views
    • Silverlight supports the complete seperation of the data and the UI.  Taking this further by just creating seperate views for say another consumer of Silverlight is pretty powerful.  You can apply the same MVC/MVP pattern inside Silverlight and attain this level of abstraction.  Jason mentions an example of being able to create a seperate view for an iPhone and only the View component has to change.  This applies to Silverlight as well for different things.  For example, I have large sized Silverlight app I want to port to SharePoint.  I can create a "Smaller View" for SharePoint so it fits nicer into the UI.  Furthermore, Silverlight Mobile is being private tested now.  I would assume that same very powerful level of abstraction applies as well to create a "Mobile view" for your Silverlight application.
  4. Unit Testable
  5. Challenges if you are not running IIS 7
    • Silverlight does NOT care if you are not running on IIS 6 or IIS 7 or Apache for that matter.  This is one feature where Silverlight has an advantage over ASP.NET MVC.
  6. Client Caching
    • In ASP.NET Web Forms or MVC, you are caching on the server.  Silverlight allows you to cache on the client via Isolated Storage (which can be increased to hundreds of megs if necessary).  This allows applications to perform ultra fast without bogging down the hosting server.

 

CONs vs. ASP.NET Web Forms

  1. Difficult to convert existing code
    • Silverlight is a completely different programming platform than either ASP.NET WebForms or MVC.  Not only will a lot of the code not convert, you also have to think about the client layer and in most cases a complete re-architecture is needed if you are replacing large modules inside your existing ASP.NET site.
  2. NOT the best SEO out of the box
    • Google several months ago started spidering SWF files and adding them to the search engine.  I think Silverlight is probably still a ways away here.  What you can do for Silverlight SEO is the basic tricks to describe the meta data tags really well around the plug in.
  3. Data access
    • Data access in Silverlight is limited to Web Services/WCF/ADO.NET Data Services.  You cannot make direct calls via ADO.NET or stored procedures to a database.
  4. Security
    • Silverlight runs on the client.  A lot of your bits are then roaming in the wild on the internet.  Furthermore,  some of the data access techniques do not support full WS* standard security.  Therefore, beyond certificate based transport security, you are either writing a lot of your own plumbing code or waiting for the next rev.  The XAML code is pretty much insecure; not many applications have their Intellectual Property in their UI.  In Silverlight, that can be very easily reverse engineered using Silverlight Spy for example. Silverlight, just by nature, is a little less secure than an ASP.NET MVC application.  Obviously, you would want to encrypt/obfuscate your Silverlight assemblies before letting them off in the wild.

In conclusion, even though Silverlight and ASP.NET MVC are two completely different technologies, they share A LOT of the same pros and cons Jason pointed out vs. Web Forms.  The only difference is that the hosting model for Silverlight is a lot simpler.  Silverlight does have its nuances with data access and security that you have to worry about.  Furthermore, you do get other benefits like client-side performance and client-caching.

kick it on DotNetKicks.com
Posted: Oct 23 2008, 07:51 by Bart Czernicki | Comments (1) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us
blog comments powered by Disqus