Software Development

Create rich interfaces with Microsoft Silverlight

Microsoft's Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications for the Web. Find out why Tony Patton is impressed with the Silverlight development model.

Web developers often frown on the use of technologies like Macromedia Flash or Adobe Shockwave to spice up Web interfaces. Since these technologies are not Web standards, they may not properly work in all browsers. Even so, some developers continue to use these technologies. Recognizing an area of technology without a presence, Microsoft has thrown its considerable weight behind an initiative to make inroads in the area now dominated by Flash with its Silverlight product.

What is Silverlight?

Microsoft describes Silverlight as a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications for the Web. The plug-in is for rendering the applications in your browser. The plug-in is available for the Mac OS (version 10.4.8) and Windows 2000/XP/Vista and Server 2003. The following browsers are supported: Internet Explorer 6 and 7, Firefox 1.5 and 2.0, and Safari.

Silverlight-based applications are developed with eXtensible Application Markup Language (XAML) and JavaScript, and it integrates with existing Web technologies without problems. The UI is defined using XAML with JavaScript handling events. This promotes the concept of separating presentation from development.

The technology

While JavaScript is an established technology, XAML (pronounced "Zammel") is relatively new. XAML is the XML-based markup language that works with the new graphic subsystem delivered with Windows Vista and .NET Framework 3.0. You can define graphical assets, user interfaces, behaviors, animations, and more using XAML.

Silverlight is closely tied to the .NET Framework, but it is self-contained; that is, it does not require Windows or the .NET Framework -- everything is available in the plug-in to handle Silverlight pages. In fact, the XAML used within Silverlight is a subset of the XAML in Windows Vista and the .NET Framework.

Silverlight's XAML focuses on the Web development aspects of the language and leaves out the desktop elements. Silverlight includes a mini Common Language Runtime (CLR) from .NET. This means that a subset of the full .NET platform that runs on desktops can be accessed from within the browser.

Silverlight development

Given the fact that XAML is an XML-based language, you can easily develop XAML (including JavaScript) with your favorite text editor. Visual Studio 2005 supports XAML development as well. In addition, a Silverlight template is available for building Silverlight pages or applications within Visual Studio 2005. The template is part of the Silverlight Software Development Kit.

Once you install the development kit, the template is available within Visual Studio 2005. You select Silverlight JavaScript application as the template when creating a new Visual Studio 2005 project. The XAML is developed, and then a Web form is developed to use the XAML and includes any necessary code. At this point, a Web page is developed that includes the Silverlight control that uses the XAML.

In addition to the XAML support in Silverlight, Microsoft's suite of Expression tools, particularly Microsoft Expression Design and Microsoft Expression Blend, allow designers to assemble graphical artifacts and UIs with XAML as the end result. Also, there is a tool available to convert existing Flash animations to the XAML format. You can learn more about Silverlight development at the Silverlight Developer Center.

My impressions

I have never been a big advocate of Flash or Shockwave when building Web interfaces. One problem with a technology like Flash is learning a whole new development environment, as well as a language with ActionScript. One positive aspect of Silverlight is its usage of existing Microsoft technologies and a tool like Visual Studio 2005 -- technologies and tools that I use every day.

The ability to develop code along with XAML and JavaScript makes Silverlight stand out from other products. For example, a Flash application may need to communicate with a back end Web service to get data, but Silverlight can include the code to handle server communications and data loading.

Silverlight requires a browser plug-in just like competing technologies, so the paradigm hasn't shifted that much. The plug-in requirement raises issues with Web standards and a Web application properly loading in all browsers.

All in all, I am impressed with the Silverlight development model; it allows you to use an XML language and JavaScript to build interfaces, and everything is available through .NET code.

It will be interesting to see if Microsoft can make inroads on the well-established customer bases of both Adobe and Macromedia. Also, it remains to be seen whether user interface developers will embrace the product.

What do you think of Silverlight?

If you have examined Silverlight, what are your thoughts? Do you like including Flash or Shockwave based content in your Web applications? Share your experience with the Web development community.

Check out the Web Development Zone archive, and catch up on the most recent editions of Tony Patton's column.

Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.

---------------------------------------------------------------------------------------

Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Development Zone newsletter, delivered each Tuesday. Automatically subscribe today!

About

Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a productio...

27 comments
henning.rolf
henning.rolf

And what is wrong with fastloading informativ easy to use pages? At least I have no need for that flashy hard to find information I'm looking for. I also has Java Script turned off. By the way, dot not is abandoned in my computer. If I can't find what I'm looking for in say 20 sec. I go somewhere else. /HeRo

rortega007
rortega007

dude, they are still having plenty of problems. they released everything a little unpolished and made a lot of us think after Mix 07 everything would be ok

akouznetsov
akouznetsov

> One problem with a technology like Flash is learning a whole new development environment, as well as a language with ActionScript. Flash and Silverlight are like fork and spoon - both are tools. You can live with just one. Or you can use both. Just don't argue one vs another.

djbeall@yahoo.com
djbeall@yahoo.com

...so if I can hook up a Silverlight UI with the power of the .net framework that would be awesome! I am a big Adobe Flex fan and have been trying to get my company to develop stuff on it, but I keep getting told it is too expensive, and customers do not want to have to pay for the licenses and to install Flex on their servers. Since most of our customers use Windows 2003 servers with .net anyways this sounds like the perfect work-around. PS - Yes Flash is cool, but storing all the logic and in the swf movies is rediculous and a pain to edit and deploy. If I can use .net to inherit classes and functions and centralize all of my business logic and keep the UI truly a presentation layer that is a huge win!

ddura
ddura

Whoever is telling you Flex is too expensive hasn't checked it out in a long time. The Flex SDK is completely free and will soon be open source. Also, Flex Builder, and eclipse based IDE is only a few hundred dollars and allows you to create as many applications as you want! Also, doing data loading in ActionScript is no different than how you do it in JavaScript or in SIlverlight. Definitely check out Flex, it makes keeping your UI and business logic in proper OO ways simple. Also, if you want to keep using .NET, WebOrb, a product from a company called Midnight Coders, allows you to VERY EASILY communicate with your .NET application on the server. Definitely check out some of their demos. Daniel Dura Adobe Systems

Justin James
Justin James

Yes, developing for it might be cheap, but what about the server stuff? The last I looked at Adobe/Macromedia stuff for something like this, it was the Flash server because I wanted to do some streaming multimedia, and it was quite pricey. Likewise for the "Flash paper" that I thought was actually really darned neat. Has that changed? J.Ja

rchung
rchung

Microsoft's website has it marked as "Soon" with their 1.1 release. http://www.microsoft.com/silverlight/system-requirements.aspx

jpalmer
jpalmer

The current CTP 1.0 is limited to AJAX-like technology. Version 1.1 will support all .net languages (C#, VB.NET, etc). Most developers I've talked to have little desire to implement serious applications in silverlight until they can use C# instead of a scripting language. Keep in mind that Silverlight is just a subset of their WPF architecture.

k1p2k1p2
k1p2k1p2

The Silverlight "look and feel" has a lot of similarities to SpaceTime. My only criticism is that since they appear and behave very similarly, there will be problems down the road. What does everyone else think? Morgan

nancy
nancy

The Author is out to lunch on his facts. "Adobe Shockwave or Macromedia Flash"? They merged two years ago .. both were Macromedia products and now both are Adobe. "Flash is not well supported in browsers"? 99% and acceptance of new versions in less than a year. Get your facts straight. Silverlight is going to do what every other Microsoft product does .. support Microsoft technologies and nothing else. how is using Visual Studio any different than learning Flash? I don't use Visual Studio so would I not have to learn a new development tool? Of course I would .. it all depends on where you come from. Microsoft's description is laughable. "Microsoft describes Silverlight as a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications for the Web." ?? What's "next generation" about something Flash has been doing for 10 years? Silverlight is akin to Flash at about version 6 .. already 3 generations behind.

Tony Hopkinson
Tony Hopkinson

technology, think of it as a way to access the entire .NET framework from within browser code on the client seamlessly. It's a bit ish at the moment and I fear on the security front but it shows promise. I know the adboys are hitting the gee whiz interface stuff, but therse way more too it than that.

jpalmer
jpalmer

re: "a way to access the entire .NET framework " Actually, the silverlight install includes a subset of the .net framework. It does not access the client's .net framework. If you need the entire framework, you need to consider either a windows app delivered using a ClickOnce link on your page or an XBAP application. The way silverlight works is that it 'sandboxes' everything it needs. This makes it secure and cross-platform.

jpalmer
jpalmer

Next generation or Web 2.0 is about delivering rich media to the web. I agree that Flash has been doing this for a long time so its not new. However, Microsoft's technology is not limited to just the presentation layer but is open to the entire development suite it has in .net 1.0 to 3.5 frameworks. This makes the development environment much more robust than flash has ever had.

ron.connal
ron.connal

Not only is Silverlight equivalent to Flash 6, with Adobe's newest kid on the block, AIR - Adobe Integrated Runtime - whether you use existing technologies like HTML/Ajax or Flexbuilder for true IRAs, they have leapfrogged Microsoft in a big way; with a real commitment to cross-platform. AIR is a remarkable product, it allows the user to continue to work disconnected and sync when reconnected and has built SQLLite support.

aspatton
aspatton

Utilizing Visual Studio is an important point since an existing base of developers who use it are not forced to turn to another development environment.

nvrtis
nvrtis

Interesting that Linux is not mentioned as being supported, but MAC is. Wonder if Microsoft considers Linux a bigger threat....

ash65867
ash65867

Tried it and it broke the Microsoft web site. The menu system Microsoft uses did not work well with Silverlight installed.

andrewmccallum2003
andrewmccallum2003

It seems to be lacking a few standard things like TextBox, DropDownList, CheckBox, RadioButton, Grid, etc.

JohnnySacks
JohnnySacks

Spent 15 minutes or so on site and didn't see anything related to business applications, it was all media related so I didn't waste any more time. Better spent on TR.

Justin James
Justin James

On the one hand, I keep viewing it as ActiveX 2.0, albeit with a bit better support in non-IE-on-Windows platforms. On the otherhand, at a technological level, I see it as a Flash killer, at least for writing applications (as opposed to graphical doo-hickeys). I am going to sit on the bench for a while and see where it goes, before dropping much time into learning it. J.Ja

Dr Dij
Dr Dij

My boss came in and said 'you have to try Gizmox.' tHAT was a day ago and I haven't had a chance to run thru their videos. Any idea where that fits in? m$ is having a webinar onthis on july 2nd. Supposed to reduce web apps 90%

JohnnySacks
JohnnySacks

.. Buried right alongside ActiveX browser objects. For any business critical application which rely on a rich user interface, Java (Swing/SWT) deployed via Java Webstart or .NET forms applications deployed via ClickOnce work fine. If browser hosted applications are still your poison, there are (after all these years) Java applets and ActiveX objects. Another path uses Flash. Yet another MicroSoft marketing blitz media barrage. Silverlight provides nothing other than a glitzy GUI to produce applets with the exception that the applets are excluded from being used on Linux, hardly a situation which fits the description of cross platform.

MadestroITSolutions
MadestroITSolutions

I still think they should stop wasting time "patching the holes" of our outdated, missused, stateless internet protocols and try to come up with a new standard that supports all these things natively. That being said, this is serious competition for the "Flashes" of the world. I can definitely see the benefits of XAML, editing tools and JavaScript integration.

techrepreader
techrepreader

Our development department has been producing applications in FLEX for over 12 months. Our Area Health Service in NSW Australia covers an area slightly larger than Germany so we have been using web based interfaces for applications for many years. Now with Flex we have ditched the few VB.net apps that were necessary because the functionality needed was beyond standard ColdFusion pages. All new applications are being built in Flex the users are extremely happy with the new interfaces and functionality that we can now provide. The applications run from finance reporting to interactive pharmacy dispensing protocols(extremely complicated drug dose calcuation and logging screens). Flex handles them all very capably.

TJ111
TJ111

I have never been a big fan of flash based websites (or similar) from a development standpoint for a few reasons. However I have been playing around with OpenLaszlo, just to see what capabilities it provides. It's a very similar idea, XML based markup (including javascript) for running web apps natively in the browser. What I think sets it apart from Silverlight is its ability to also export its code into Flash or DHTML (ie, Ajax) if you don't want to install the servlet on your server. I work primarily on the writing the backend of Ajax based web pages, so this sort of thing is interesting. I was wondering what other people think about Silverlight vs. Flex vs. OpenLaszlo.

Tony Hopkinson
Tony Hopkinson

We are having a look at it for stuff two years down the line. As many know I'm not a big fan of clientside scripting, however that's not going to go away, so putting some real control through .NET security on what the client allows, I view as a good thing, or at least the best I will be allowed.