PDC 2008 - Silverlight 2 Wrap-Up
PDC (Professional Developers Conference) 2008 is over and there was a lot of information released over the course of the 4 days. You probably have heard some of it if not all of it. I wanted to write a post to summarize the information pertaining to Silverlight either directly or not directly that was released last week. Over the course of the week, Silverlight developers were bombarded with information that was coming out and this post's goal is to help developers get a handle on all of the information. Here is the summary of what has been released during the week of the PDC 2008:
- Silverlight Tools for Visual Studio 2008 SP1
- Silverlight Control Toolkit
- Expression Encoder SP1
- PDC Silverlight Videos (directly related)
- PDC Silverlight Videos (indirectly related)
- Silverlight 2 for Mobile Devices
- WCF REST Starter Kit
- Silverlight and SEO
Silverlight Tools for Visual Studio 2008 SP1
Silverlight Tools for Visual Studio 2008 SP1 were released over 3 weeks ago. However, for those people who are detailed oriented, this release was labeled as RC1. I posted a question on this on the forum the day this was released. Apparently, this was NOT the final release of the tools. On 10/30/2008 Microsoft released a new build of the Silverlight Tools. I don't think anything has changed, but regardless, you will want to update your tools to this new build. The new build of the tools can be downloaded here: http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&displaylang=en
Silverlight Control ToolKit
The Silverlight Contol Toolkit was announced at the PDC 2008. It has a bunch of great controls, themes and charting cababilities. The big news is that the toolkit is open sourced and it you can extend it or build your own controls. Not only is it a great way to enhance your current Silverlight applications, but it is also a great way to learn about Silverlight control development and architecture. Shawn Burke's team has also included a bunch of unit tests using the Silverlight Framework so you can learn how to implement some TDD with Silverlight. You can download the toolkit here: http://www.codeplex.com/Silverlight
Expression Encoder SP1
Expression Encoder SP1 has been released. I like the approach Microsoft took by adding service packs to both Blend and Encoder rather than forcing people to upgrade. Therefore, people who have invested in version 2 are getting their money's worth. SP1 of Encoder allows you to create custom Silverlight 2 video player skins. It also includes H.264/AAC support. The service pack is available here: http://www.microsoft.com/expression/try-it/default.aspx?filter=servicepacks (Note: Expression Encoder also has an Express version which will work after the trial expires allowing you to do some basic things.)
PDC 2008 Silverlight Related Videos Online
If you weren't at the PDC, Microsot published the videos from the 4 days to the web. You can watch the PDC 2008 Videos online here: https://sessions.microsoftpdc.com/timeline.aspx. Here are the videos that are either directly or indicrectly related to Silveright development and I have some notes on the ones I watched.
If you are an architect, development manager, etc., I highly recommend watching some of these videos and then getting your team together for a lunch or a meeting and watching this together. I find this spurs developers thinking together about the current and future technology earlier.
PDC Silverlight videos (directly related to Silverlight)
PDC Silverlight Videos (indirectly related)
Silverlight cannot consume data directly from objects or databases located on servers (even if it is the same server Silverlight is hosted on). Silverlight is all about consuming data from services. These videos are an absolute MUST to watch if you are a Silverlight developer and consume data from services.
-
-
-
Excellent video that deals with ADO.NET Data Services development and the Entity Framework. This video shows some of the cool interceptors for security and enhancing services that exist in ADO.NET Data Services. If you are building a simple Silverlight client that needs, call batching, smart data and/or security concurrency management, ADO.NET Data Services provide a lot of great features here.
Silverlight 2 For Mobile Devices
Microsoft is porting Silverlight to mobile devices. This is a really welcome feature. Many users who have an iPhone know that Apple is currently "blocking" the availability of Flash to mobile devices. This is where Silverlight has a potential advantage and put a dent in the Flash market share by targeting mobile devices. Most of this information is coming from this video here from the PDC: http://channel9.msdn.com/pdc2008/PC10/
Here are some of the highlights from the PDC:
- By 2010 statistics show that there will be about 4 billion mobile phones in the planet. There is a huge opportunity here! So how do you write applications that are rich to thousands of users? Silverlight :)
- Silverlight 2 (That's right; the same Silverlight 2 on desktops) has been announced for the mobile space.
- Plublic CTP will be available in 2009 (Q1). My guess is that they will release this at the same time as MIX 2009.
- The really cool part is that the SL 2 on mobile requires NO CODE changes to work on a mobile device where Silverlight is installed!! That is really nice and very powerful and one code works on both the desktop and mobile devices.
- The Baby Smash demo really drives this point home further. So not only can you share code between WPF and Silverlight 2, you can share code between WPF, Silverlight 2 and Silverlight 2 Mobile! That is impressive; three platforms with one codebase.
WCF REST Starter Kit
One of the ways that Silverlight can consume data is through RESTful services. WCF was part of the .NET 3.0 framework back in 2006. In 2006 REST services were just starting to get traction as many Web 2.0 companies used this design as a preferred method for their service APIs. WCF .NET 3.5 has added some features for REST services. However, there was still a lot of plumbing code in order to write proper RESTful services in .NET 3.5. The MySpace API is a great example of what can be done with WCF and REST on a very large implementation.
In order to make writing some of the WCF REST services easier, Microsoft released the WCF REST Starter Kit during the PDC.
The WCF Starter Kit makes building RESTful services a lot easier. It also shows the impressive architecture of WCF. It can be enhanced with using attributes and interceptors to build a REST architecture for services.
Silverlight and SEO
Several months ago Google announced that it can now crawl Flash-based applications. This is pretty important because now Flash-based content is searchable and this is critical to any revenue model that is based on high-page ranks on Google (sales, ads, etc). Silverlight currently cannot be crawled by Google (maybe in the future). However, there are couple things you can do right now to make sure your Silverlight application gets crawled by Google:
- Ensure that the page hosting your Silverlight content has proper meta tags and place the SEO there.
- You can also place a page for a "deprecated" client. Therefore, if you receive a hit from a user that doesn't have Silverlight, you can bring them to an HTML page rather than the full Silverlight client. This way when the Google robot tries to crawl your site, it will crawl it based on the HTML page.
This information is really important for developers that are jumping into RIA. Most architects are ready to jump right into the technologies and try to solve problems with RIA. However, things like SEO sometimes might fall through the cracks and might not be acceptable to a client. Check out this post for more information on Silverlight SEO Optimization: http://nerddawg.blogspot.com/2008/10/search-engine-optimization-for.html
Silverlight 2.0 - Concepts To Become A Silverlight Master (Series Part 2 - WCF)
Series update: I changed the name of the series as the name was slightly confusing.
Series Articles:
Silverlight 2.0 technology is based on a web plug-in that runs on the client's computer. Writing applications/tools/games that don't depend on data is straightforward and doesn't require the Silverlight developer to think much beyond the client's domain. However, what if the developer wants to introduce external data into their Silverlight 2.0 application?
First, the bad news:
- Silverlight 2.0 currently runs on a small subset of the .NET 3.5 Framework. This means some of the "direct" data channels/communication libraries are not available to you (i.e., remoting, COM, database, etc.)
- Silverlight hosts its app domain on the client's workstation. This means that even though it is a web technology hosted on a web server, it can't leverage resources on the web server that do not cross the web server domain (i.e., database calls, local dll files that call a database, local dll files that consume a service)
- Another limitation is that because Silverlight utilizes a minimal/secure plug-in architecture, you cannot access local workstation data channels easily. For example, a fat client windows application can call a database, windows/web services, make remote calls, etc. Most of these (as you guessed it) are not available to you.
So HOW can I consume some data from an external data source? Silverlight 2.0 Beta 2 currently supports these communication channels:
As you can see from the list above, Silverlight 2.0 (as of Beta 2) supports a variety of communication mechanisms. Most of these, excluding Sockets/JavaScript-bridge, focus on service technology. Therefore, as a developer, you can talk to the data store inside your service application and expose it via any types of these services. Consuming these services can be done several ways, but that is not the focus of this article. Designing these services can be done several ways as well.
As a developer, what is the best way to design services that a Silverlight plug-in client can consume? Luckily, this is where WCF comes in (Finally, the meat of the article).
WCF is an acronym for the Windows Communication Foundation, which was introduced in .NET 3.0. WCF (like LINQ/.NET) is one of these technologies that is hard to summarize in one good definition. Some developers simply say WCF is web services or a way to design SOA. My definition of WCF is actually not mine. This definition is from Juwal Lowy's forward from his great book Programming WCF Services:
"WCF is a fundamental technology that provides an easy and clean way to generate services and applications in compliance with what I regard as sound design principles."
WCF (without going into too much detail) allows you to architect applications by applying best practice guidelines automatically. Security, throttling, opt-in serialization, logging, etc., are handled for you just by creating a service inside the WCF framework and setting config/attribute values. Juwal Lowy (in web casts/book/classes) says you can spend time writing plumbing code and trying to adhere to best practices or use WCF and allow it to do the majority of the work for you.
Silverlight runs on a subset of the .NET 3.5 framework, so it does not support all of the WCF bindings and can't consume every type of WCF binding/endpoint. However, from the list above utilizing WCF (as your service engine) you can design: SOAP 1.1 Services, Duplex Services, AJAX Enabled Services & REST Services. All of these can be consumed by the Silverlight 2.0 client.
A great aspect of WCF is that it allows you to write your application and expose it using various binding endpoints supported by Silverlight. Furthermore, existing WCF services can simply be "Silverlight enabled" by providing a compatible Silverlight endpoint. Depending on the functional requirement, of course, this might not be possible.
The diagram below demonstrates the same services being consumed by different clients using different endpoints:
Quickly doing a search on services+Silverlight, you will notice that WCF comes up a majority of the time. Microsoft is pushing WCF heavily as a best practice for writing services for Silverlight. In fact, after installing the Silverlight 2.0 SDK, you have a new template called "Silverlight-enabled WCFService" for quickly creating WCF services that can be consumed with Silverlight.
Silverlight 2.0 Beta 2.0 allows the developer to configure the WCF service inside a ClientConfig file. This is a real nice add for additional configuration of WCF services, especially if you are a software vendor that needs to change connections/tweak settings for different deployments declaratively.
WCF (in .NET 3.5) has great support for creating RESTful services. RESTful services are used all over the place: Flickr, MySpace, Amazon, etc. WCF allows you to quickly create low/high REST services that can use XML, JSON or RSS encoding. Silverlight can consume these easily. In fact, many examples online show this by communicating with external REST services and manipulating the data on the client (i.e., using LINQ).
Summary of benefits using WCF to consume data in Silverlight:
- All the different Silverlight service types can be designed with the single WCF technology. Basically, anything you can do with other service design you can do with WCF. However, with WCF you are doing it with a single technology
- Allows the developer to design services focusing less on implementing best practices and plumbing code (WCF's biggest selling point, since it does a lot for you out of the box)
- WCF endpoint abstraction allows the developer to create service endpoints for both Silverlight and non-Silverlight consumers (while sharing the same code)
- Microsoft recommended best practice. WCF includes first class support in Silverlight: online examples, Silverlight-enabled WCF service template and clientConfig XML configuration file
- Best practice for the future. As Microsoft adds additional support to the Silverlight service stack, developers can be assured that probability-wise this will be done via WCF. For example, Duplex services (introduced in Beta 2)
In summary, Silverlight and WCF technologies complement each other very well. WCF is a single technology that provides you a single design mechanism to create a variety of solutions for exposing your data to a Silverlight client. WCF is not a requirement in order to consume data inside Silverlight (lots of examples online with 3rd party REST services). However, because of how well it works with Silverlight and deprecates other SOA design (at least in the MS world), it is a no-brainer that WCF is recommended by Microsoft. In my opinion, WCF is a technology every developer needs to master in order to be effective with consuming data inside Silverlight.