In-Depth

Silverlight Ascendant

It was day two of the recent Microsoft Professional Developers Conference (PDC) in Los Angeles, and the early reviews of the event were lukewarm at best. Microsoft had refined its guidance around Windows Azure cloud computing and produced some rehashed evangelism for Windows 7, but developers at the four-day confab were clamoring for something new. PDC, after all, was the event that launched .NET back in 2000 and the Windows Azure initiative in 2008.

As Andrew Brust, chief of new technology for consultancy twentysix New York and a Microsoft MVP and regional director, commented at the time: “This was the year that the ‘P’ in ‘PDC’ stood for practical.”

So credit Microsoft Corporate VP of the Developer Division Scott Guthrie for his game-saving bombshell during the second day keynote. Because when Guthrie announced the surprise release of the Silverlight 4 beta — the latest version of the Microsoft rich Internet application (RIA) platform and runtime — it immediately became the smash hit of the show.

“The Silverlight 4 stuff was huge!” enthused Stephen Chapman, author of the Microsoft Kitchen blog and a longtime Microsoft watcher who attended PDC. “I think Silverlight 4 will finally take Silverlight out of its Flash wannabe status and catapult it into its own respectable technology.”

Behind the excitement: An aggressive upgrade to the Silverlight platform that targets a host of long-lamented platform limitations, and thrusts the RIA technology firmly into the realm of mainstream .NET development. With the release slated for the first half of 2010, it raises the question: Is it time to consider Silverlight as a legitimate vehicle for business-oriented .NET application development?

Taking Stock of Silverlight 4
Todd Anglin, chief evangelist for leading component maker Telerik Inc., says Microsoft really started delivering the line-of-business goods with Silverlight 3. He singles out the addition of effective data binding support and .NET RIA Services, since renamed Windows Communication Foundation (WCF) RIA Services, as key capabilities for business development.

“A lot of what they delivered at PDC in Silverlight 4 — improved access to the local file system, the ability to print in Silverlight, the ability to access the clipboard — all of these things are core line-of-business functions,” Anglin explains. “There are very few things you can point to now that would prevent you from creating line-of-business applications.”

Brian Goldfarb, director of the Developer Platform and Tools Group at Microsoft, says Microsoft focused on three areas when building out the Silverlight 4 beta: rich media, business-application development and out-of-browser execution.

On the media side, Silverlight 4 added attractive capabilities like native webcam and microphone support, enhanced digital rights management (DRM) and media protection, and support for multicast streaming for efficient broadcast of digital media.

Perhaps most notable were the raft of improvements that break Silverlight out of the rich media penalty box. Silverlight 4’s out-of-browser execution capabilities bring the platform to parity with Adobe AIR, and enable apps to conform to familiar desktop deployment models. Goldfarb singles out support for Silverlight “trusted applications” that provide access to local hardware devices as well as to Windows APIs for controlling application window size and position. Applications can now read and write to the local file system, make use of cross-site networking and support pop-up notification. Developers can also implement custom window chrome for unique and effective UI designs.

Finally, Goldfarb says Microsoft targeted functionality vital to business application development. Native printer support — long a target of developer complaint — has been added, as have important UI elements like drag-and-drop, right-click and mouse wheel support. The native rich text editor and support for internationalization, in particular, appeal to developers serving large enterprises, Goldfarb says.

Other supported features in Silverlight 4 include implicit styling, HTML hosting for plug-in controls like Flash video, and updated data and networking functionality, including databinding enhancements and the updated WCF RIA Services stack, which promises to be critical for rapid application development on Silverlight.

Ultimately, Goldfarb says, Silverlight applications will reach beyond the desktop and Web to mobile devices and other sectors. “We think that Silverlight becomes a common runtime across all these different device footprints,” he says.

There are also promised performance upgrades. Silverlight 4 will take full advantage of the just-in-time Common Language Runtime (CLR) compiler in .NET, potentially doubling performance of processor-intensive apps, according to Guthrie. Application start-up will also be significantly improved, while the new Silverlight Profiler API gives developers the ability to assess and optimize applications.

Visceral Response
One powerful argument for Silverlight as a unifying runtime is its use of Extensible Application Markup Language (XAML), the same technology employed in Windows Presentation Foundation (WPF). Since launching Silverlight 1.0 in April 2007, Microsoft has talked about the benefit of sharing XAML code between Silverlight and WPF. With Silverlight 4, developers can compile code once and run the built assemblies on either the Silverlight 4 or .NET 4 runtimes. Five key assemblies enable code portability between Silverlight 4 and WPF: Mscorlib, System, System.Core, System.Component-Model.Composition and Microsoft.VisualBasic.

Jeffrey Hammond, principal analyst at Forrester Research Inc., says the new capability will appeal in an era where apps are increasingly becoming “multi-channel,” providing similar services and user experiences across multiple computing and mobile platforms.

“I think we’ll see that idea pervade the enterprise over the next three years. That’s where I think the Silverlight/Flash/WPF approach starts to become a little interesting. I can create these XAML components and just use them as-is in my multi-channel software strategy,” Hammond says, noting that XAML gives Silverlight a “big advantage” over Flash.

The response in the developer community to the Silverlight release has been almost universally positive. Miguel de Icaza, vice president of developer platforms at Novell and head of the open source Mono Project, called Silverlight 4 “a case of doing the right thing for users and developers” in a blog post soon after the release. “There are many other great features in Silverlight 4, but none as important as Silverlight becoming a universal runtime for the CLR. This is a revolution,” de Icaza wrote.

Hammond says Silverlight 4 flips the decision-making matrix for .NET dev shops. He says more and more dev shops should consider Silverlight 4 as the default runtime choice for desktop and Web development. “I think we’ve passed the inflection point with Silverlight 4,” Hammond notes.

Early returns on the beta bits delivered at PDC have been positive as well. Jason Beres, director of product management at component maker Infragistics, says his firm’s developers have been happy with what they’ve seen. “I honestly don’t think we’ve reported that many bugs,” Beres says. “It’s a very full-featured beta. It’s pretty solid. It’s very impressive how far they’ve gotten this thing.”

Evan Hutnick, developer evangelist at Telerik, calls the Silverlight 4 beta “very robust” and says it’s ready for developing on, despite a few quirks. He says Telerik customers working on Silverlight 4 projects have been very impressed with the advanced rich-text editor and the printing and clipboard support. “People seem really confident in this beta right now,” Hutnick says.

Chris Klug, senior Silverlight developer for consultancy Intergen Ltd. in New Zealand, says Microsoft has “done a great job so far” with the beta. He’s particularly impressed with the tooling support for Silverlight 4 in Visual Studio 2010. “I like the idea that the design view is now interactive and that you can use it for things you’d normally do in Blend. I also love the improved support for XAML in the code view. It seems snappier and has a bit more help for those of us that like writing their own XAML,” he explains.

Klug’s one concern: That Microsoft sometimes focuses too much on “drag-and-drop functionality that few developers will want to use in real projects.”

Ben Dewey is a senior software developer at twentysix New York who has worked with Silverlight and WPF for years. He says Silverlight 4 offers .NET developers a seamless experience. “There’s really nothing that stops me in my daily life and makes me realize I’m not working directly with the .NET Framework. Everything I’m used to working with on a daily basis is there. I do a lot of LINQ stuff and all the LINQ features are available to me,” Dewey says.

Coupled, Loosely
One thing Silverlight 4 will certainly promote is the use of loosely coupled architectures. Silverlight employs the Model-View-View Model (MVVM) architectural pattern, which is based on the Model-View-Controller (MVC) pattern in ASP.NET MVC. MVVM eliminates “code behind” from the View layer so visual elements can be effectively managed by designers, while developers address the code logic in the View Model.

The separation of concerns enforced by MVVM can make for much more manageable and maintainable application code. Goldfarb says the ascendance of application lifecycle management and test-driven development has made such patterns vitally important.

Dewey says the MVVM implementation in Silverlight 4 is “very clean,” but he worries there’s room for confusion as developers new to the approach struggle with Silverlight. “It’s kind of a disconnect. The samples are all code-behind, but best practices are all MVVM. It’s not trivial to make that conversion,” Dewey cautions.

He singles out Silverlight’s support for Managed Extensibility Framework (MEF), noting that it lets developers extend application interfaces using components that are discovered and compiled at runtime. “The loosely coupled kind of ability to do this is nice; these architectures that are separated but can get kind of discovered and compiled at runtime. It’s kind of cool,” Dewey says.

Another resource for Silverlight developers is WCF RIA Services. “WCF is the foundational glue for all our communication protocols,” says Microsoft’s Goldfarb. WCF RIA Services gives Silverlight developers a way to implement — across tiers — common scenarios such as validation and databinding.

Peter Vogel, principal of PH&V Information Services and a frequent contributor to VSM, calls WCF RIA Services “the big story” of Silverlight 4. “Effectively, it reduces Web Services to what it should be: plumbing. The goal is to make creating distributed Web Service applications as easy as creating Access applications,” Vogel says.

Telerik’s Anglin says the value of WCF RIA Services boils down to one word: productivity. “If productivity is your primary driver and you’re doing a relatively standard line-of-business application, then the tradeoff is greatly in your favor in terms of the amount of time [WCF RIA Services] is going to save you and the features it will deliver under budget,” Anglin says. “The WCF Services layer — the automation of that — really is the productivity story here.”

Dewey, however, warns that WCF RIA Services isn’t for every project. “We put it all in for an application that didn’t really need it and ended up fighting it the whole time. There’s too much hand holding and too much code generation for my personal preference,” Dewey says. “If you’re doing a simple CRUD [create, read, update and delete] application I think it works great. Once you get out of the realm of a one-tier CRUD application, I don’t think it works well.”

The Mobile Story
If Silverlight 4 has a weak flank, it’s the lack of a well-articulated mobile vision.

“This is where I think Flash today is better than Silverlight. The Adobe strategy has been pretty powerful in terms of making connections with different platforms,” says Al Hilwa, program director for Application Development Software at IDC. “I think that actually the Silverlight team will probably have better support for devices in the next couple years.”

Hilwa also looks at developments like Microsoft adding support in Silverlight 4 for the Google Chrome browser as a sign that Microsoft “will not let anyone stop them.”

Microsoft’s Goldfarb says the company will provide detailed mobile guidance for Silverlight development at the MIX10 event in Las Vegas, March 15-17. He says Microsoft is looking to support a variety of mobile platforms — including the Google Android, the Research In Motion BlackBerry and the Apple iPhone — and that Silverlight will provide a uniquely compelling developer experience for cross-platform applications.

“We’ll have Silverlight running on [many] devices. It’s the same code, it’s the same tool — it’s identical. The work involved is literally customizing the front-end UI for the devices themselves and for the keyboard, and then taking advantage of platform-specific extensions,” Goldfarb says. “You’ll have the ability to optimize for the unique characteristics of the device itself.”

The rapid turnover of the Silverlight code base is also cause for concern. There have been four iterations of Silverlight released, including the Silverlight 4 beta, since Silverlight 1.0 went final in April 2007. Silverlight 4 is expected to go live in the first half of 2010. The heady pace may not suit larger companies that rely on stable platform releases.

“Enterprises don’t typically like to live on the bleeding edge,” says Anglin. “Certainly, people I talk to in the community would like to see a leveling-off of the pace.”

“It’s a careful balance we have to find,” responds Goldfarb. “The speed and innovation is a market-introduction pace.”

Goldfarb says Silverlight 4 includes a Quirks Mode that provides full compatibility for Silverlight 3 applications running in the newest runtime. Backwards-compatibility for older Silverlight apps will be a feature of future Silverlight runtimes “ad infinitum,” he says.

Concerns about platform updates aside, Goldfarb says Silverlight has earned a series of key wins over the past year, including a financial visualization app integrated into Bloomberg terminals and a factory operations-automation app developed by Rockwell Automation Inc.

“These deployments were all done on the latest version of Silverlight, Silverlight 3. That was a big inflection point. That was where these capabilities were really turned on,” Goldfarb says.

Getting up to Speed
When it comes to selling Silverlight development, Microsoft preaches the benefits of a common tool stack, familiar languages and a matured .NET skill set. Still, dev shops looking to move to Silverlight 4 face a learning curve.

Forrester’s Hammond says developers may struggle as they delve into the realm of service-based and RESTful architectures employed by Silverlight. “I can’t just take the skills I learned with VB6 and VB.NET and run,” he says. “Fortunately, it’s not as big as the jump from procedural to object-oriented programming.”

Business Applications

  • Printing support
  • Rich-text editor (supports multiple languages, left-to-right text and copy/paste)
  • Right-click and mouse wheel support
  • Implicit styling
  • Drag/drop support
  • Bidi and right-to-left support for global applications
  • HTML hosting (can host plug-in controls like Flash video)
  • Commanding and Model-View-View Model (MVVM) controls

     

Data and Networking Functionality

  • Databinding improvements
  • UPD multicast support
  • REST enhancements through ADO.NET services
  • Updates to Windows Communication Foundation RIA Services (formerly .NET RIA Services)

     

Beyond the Browser

  • New sandboxed features (windowing APIs, notification pop-ups)
  • Introduces “trusted applications”
  • Custom window chrome
  • Utilizes local file system
  • Uses cross-site networking
  • Enables a full-screen keyboard
  • Provides hardware device access
  • Provides access to Windows 7 APIs

 

Source: Microsoft

Dev shops that intend to deliver Silverlight apps over the wire also need to avoid needless calls to redundant libraries or use of custom code that duplicates functionality in the base runtime, says twentysix New York’s Dewey. He says the first thing he does with Silverlight projects is review references, which often point to packages and libraries that aren’t needed for the app and result in increased download size. He singles out references to system.net and system.web.browser. His advice for streamlined app delivery: “Do everything you can with the Silverlight toolkit and the stuff that’s in the box.”

Infragistics’ Beres urges developers to start working with VS2010 right away, and to fully understand how app data is accessed and designed to avoid running into a wall after moving to Silverlight 4. Telerik’s Hutnick, meanwhile, warns developers that finding useful, up-to-date coding help for Silverlight can require detective skills.

“It comes down sometimes to following the right people on blogs or on Twitter,” says Hutnick, who recommends Jesse Liberty’s Silverlight Geek blog as well as Brad Abrams’ blog for information about WCF Services. John Papa’s blog on Silverlight is another useful destination.

“As a new developer, if you’re not aware of these guys you might get lost trying to find new information,” Hutnick says.

Other resources include the newly launched Silverlight Web site at Microsoft.com/Silverlight, as well as the Silverlight developer community site at Silverlight.net.

Ultimately, the single most important bit of advice might come from Forrester’s Hammond, who takes a big-picture view of the challenge facing dev shops.

“I think the biggest thing is to really look at a rich Internet application client as your default choice, and then force your developers to justify why you need to go beyond that,” Hammond says. “Basically say, ‘unless you give me a compelling reason, we’re going with RIAs because they’re easier to deploy and give us cross-platform capability, and give us a better user experience for our users, who are increasingly mobile.'”

About the Author

 Michael Desmond is editor in chief of Visual Studio Magazine and former editor in chief of Redmond Developer News. He has served as senior editor of news at PC World and executive editor at Multimedia World magazine, and has written for dozens of publications and Web sites. Desmond has also written four computing books, including Microsoft Office 2003 in 10 Simple Steps or Less.

Very nice article on Silverlight4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s