Tuesday, April 22, 2008

Great Silverlight 2.0 Tutorial

Everybody who knows me knows my feelings on doing complex WebGUI. In short i think it is stupid - and also i have never met a developer yet who can show me a robust and simple way of managing the events of a web page. It is always, always fixes like; hidden fields, setting stuff in prerender etc etc.

So my personal opinion of this is - don't do it! Web is for simple stuff. The moment a request about a tab control or thing posting back is being said I would raise a big warning flag. You'll get into trouble. (Of course I can only speak for ASP.NET, and love to be convinced otherwise).

Luckily there is help on the way.
  • You could either stick with simple HTML and use ASP.NET MVC which removes all the crazy event-handling from the ASP.NET WebForm model. Basically this solution could be called "Someone Else's Problem" since someone have to figure out the web page. But they can go crazy with it, separate from the logic. You are providing a controller form the design-folks to use. The person most appropriate for the job - in my case anyway.
  • Another way is to design the application as an Sliverlight application. This gives you the opportunity to really go crazy with the layout. With Silverlight you can do anything you can do in a Windows Form, design wise, and more. For the client the download of the Silverlight executable is done in seconds and then the application is run in the browser.

As you might notice both these suggestions are explained by my new house god Scott Gutrie (ScottGu). He seems to have something to say about almost everything in our area. Check him out - well worth the time.

3 comments:

Anonymous said...

Tja Marcus.
You need to get your hands dirty with MVC, because it's obvious you have not worked with it enough to point it out as a real option. It's not there yet. Try to create a grid and supply row-editing in it and you will see for yourself.

To force end users to go for Silverlight for supporting simple scenarios like that is like asking a person to buy a new car just because the spark plug needs to be replaced. Asp.net with it's event will be around for a long time, and I think you are a bit unfair with it's event handling, it's not that bad.

Anonymous said...

Hehe - I thought that someone would take that bait...

You're right Daniel, I haven't done anything "real" with ASP.NET MVC, but as you say i like what it promise. And I especially like to get rid of the event-model from ASP.NET.

For, to continue to answer your comment, the event model of ASP.NET web forms might be great, even. I just haven't yet found a single developer who can explain who to structure your application so that it's easy to follow. Up to now I’ve seen loads of workarounds, but now great solutions.

Your'e of course right about Silverlight for simple scenario that would be a big overkill. But ever so often I find myself creating "Windows"-application (you know; 10 tabs with 3 sublevels on each, grids with dynamically filled controls etc.) in web pages.

In those scenario I would have loved to use Silverlight, but not for your standard vanilla webpage, with simple data presentation and simple user interaction.

Anonymous said...

"I just haven't yet found a single developer who can explain who to structure your application so that it's easy to follow."

But you have met me!

Seriously, for apps like "Windows" with tabs all over, you normally are targeting a limited group, not the WWW. Then I would use... take a guess... Yes, a Windows app. The flashy (!) Silverlight apps have a long way to go before taking over the scene where Windows apps still rules. And when that becomes a real option, I would opt for Silverlights bigger brother/father WPF.

(And you should think of the event-model of ASP.NEt as powerful, not as a bad thing, you can hook whatever you want, or nothing at all)