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 2 for Mobile - Why you should start using a MVC pattern

Silverlight 2 for Mobiles was announced at the PDC.  I wasn't there, but I read about it on Chris Hayuk's blog here.  The real cool part of the announcement is what they announced that there will be no changes required to your code.  So, this is not some Silverlight-type Compact Framework step child subset of .NET.  To quote Chris exactly:

"YOU DO NOT HAVE TO DO ANYTHING

TO MAKE YOUR SILVERLIGHT APPLICATION TO MAKE IT WORK ON THE MOBILE,

NO RECOMPILING, NOTHING."

That is a pretty cool goal if Microsoft achieves this kind of transparency with the Silverlight 2 plug-in on mobile handhelds.  However, to think that your 1280x1024 site with huge graphics and animations is going to automatically scale properly is ludacris.  However, this is what software design/architecture patterns were made for.

You have problaby heard of the ASP.NET MVC Beta out there that has all the no postback and no viestate fluff etc.  However, the MVC pattern at its core seperates the business logic from the UI.  For example, in your web form you have a button and then you write a click handler to print "Hello".  In ASP.NET this would be handled all in your codebehind cs file.  With the MVC pattern changes this where the user click is handled by the controller and then sent to the model.  I am not going to go over MVC in any kind of detail.  However, the main thing to understand is that the UI code is seperated from the business logic properly and other UIs can simply be plugged in with a different View component.  This lends itself very nicely to the Silverlight MVC pattern.  Imagine writing an application in Silvrerlight 2 and simply swapping out the View for Silverlight 2 Mobile and the entire application just works.  No code changes just that inside a regular browser you will load a normal View object and for Silverlight 2 Mobile you will use your Mobile View.  This mobile view might be: simpler in scale, use a simpler/clearer theme, use less animations in order to fit nicely inside the smaller resolution screens.  Depending on how your app is designed this might be all enclosed inside your XAML.

 

I had my "oh that makes sense now" moment with MVC several months ago, after seeing an example similar to this.  Hopefully Silverlight developers can see that using a pattern like MVC (or MVP etc) is really powerful and not just some loosely thrown around "best practice".  Furthermore, hopefully this example with Silverlight 2 Mobile helped.  If Microsoft achieves its goal of being able to have one single runtime for the web and mobile; investing in the MVC pattern can potentially save you a ton of work in the future if you are thinking about targeting the mobile market.

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