I presented a webcast today as part of our ongoing series of precursor webcasts to the Windows Server 2008, Visual Studio 2008 and SQL Server 2008 Launch. If you have not heard of the launch, you should head right away to www.heroeshappenhere.co.in and register yourself in one of the several hundred cities that we are taking this launch to in India.
I had a good audience and also felt that there was a lot of genuine interest in Smart Client Development. That is not so much of a surprise given that more and more applications have a hybrid software+services approach to leverage best of both worlds - desktop and web.
My session focused on 4 different buckets of Smart Client Development:
Smart Client Applications do not have a single definition. My view of these applications are that they are primarily desktop applications, that can have a few other "smart" features, such as:
- Rich presentation providing users with a very good experience
- Flexible UI that can be modified and keep improving over time (pretty much like web applications do)
- Local data caching for master data, offline transactional data, etc.
- Protection of some sort for the local data - both from security and from data corruption
- Synchronization of data when "online" with conflict resolution, if necessary
- Seamless deployment features such as auto-updates making it also easy for the software publisher to publish new versions
Most of the above are a breeze with components and frameworks that are available today - and with Visual Studio 2008, development of most of these becomes even more easier.
The webcast showed how you can leverage the following technologies. I am not going deep into the demos here, because there were many, many steps involved and I am sure it will be tedious for you to read as well as have a high chance of missing something. I will point you to resources, including the recording of my webcast, to watch these instead.
The technologies I talked about today are:
Windows Presentation Foundation / Windows Forms
WPF is a great way of creating rich applications with vector graphic elements, 2D, 3D, document-oriented applications, etc. Windows Forms, a technology that has been around longer, continues to be a great technology to build desktop applications that forms-oriented, task-oriented (like a taskbar app, control panel, etc.) and do not require all the richness of WPF.
A more detailed discussion on which technology to use when is something I posted in this post a while ago. The best part is that the interoperability between these two is fantastic - both provide a "control" that can host the other into one of their "windows" - you can put a WPF control into a Windows Form or vice-versa. This means even existing Windows Forms Applications can start using some WPF richness for new features that require data visualization of high interactivity.
Microsoft Expression Blend and Visual Studio 2008 combine to provide a rich, seamless designer-developer process for creating these applications. Blend provides all the designer tools whereas VS 2008 provides all the developer power.
There are also new enhancements to WPF with .NET Framework 3.5 and you can find the entire list here. A video describing the features can also be found here.
Scott Guthrie also blogged about an update to WPF that we are planning to release later this year which will add more flexibility in deployment options and also provide performance boosts.
If you are a beginner on WPF, the community website is www.windowsclient.net and the best place to start is the WPF Video Gallery.
SQL Server Compact Edition
Another cool piece of technology I discussed today was SQL Server Compact Edition (or SQL Server CE).
SQL Server CE is the compact edition of the SQL database and was used in a prior version in the Windows Embedded/Mobile world because of the necessity of small footprint there. That technology has evolved now to provide a common base technology called SQL Server CE that you can still use in that world, but can also use in building PC applications. In here, you can actually embed a full database within your application and query data using ADO.NET with the same ease as you would if you were using SQL Server Express or higher versions SQL Server itself.
The neat thing about using SQL Server CE is that you do not need to have SQL Server (of any kind) installed on the client system. So it is a true database engine embed that doesn't need any administrative privileges or huge local services to be running.
You can learn more and download SQL Server Compact Edition 3.5 today from http://www.microsoft.com/sql/compact
A video tutorial of using SQL Server CE with a slightly older version (3.1) is available here and should get you introduced to the basic concepts.
Microsoft Sync Framework
Probably the coolest demo (at least according to the presenter :)) was showing off the Microsoft Sync Framework CTP Refresh 1.
Microsoft Sync Framework is one of those frameworks that you have to use to believe! It is unbelievably simple for the enormously huge tasks it accomplishes. It can do any kind of synchronization - between PCs, between PC/mobile/device, between client and local server, between client and Internet server, between databases - anything. Ask it to sync and it obeys!
With Visual Studio 2008, the integration is unbelievable. I did a whole demo of local client/server sync between a SQL CE database and a SQL Server database running on my system with part data locally cached, part directly accessed - all of it with just ONE LINE of code and in well under 15 minutes.
You might want to give it a spin yourself by downloading it from www.msdn.com/sync - you will need both the Microsoft Sync Framework and Microsoft Sync Services for ADO.NET v2.
Excellent video tutorials (albeit a bit lengthy) are available here, here and here. I used a large part of the third video for my demo today. The videos also contain customizations you can make to the Sync APIs that I did not have time to cover today.
ClickOnce
Finally we talked about ClickOnce APIs in .NET Framework for easy publishing and auto-update. I have uploaded the code I used today along with the presentation (link below). The simple demo I used today was based on this video that can walk you through the steps all over again.
Presentation and Demos
You can download today's presentation and all code samples I did today (finished samples) from here. (The presentation is in PPTX format - you might want to download a viewer here if you don't have Office 2007). I do encourage you to go through the video links I mentioned above as well to get more information - I was talking too many technologies in the 1.5 hour session - many more details are available in the videos that are dedicated to these topics.
The entire webcast on-demand recording is available here. You will need to register to download this, if you haven't already attended the webcast.
So there! My part of the promise to post all the links and the pptx/code is done. So now there's nothing stopping you from building awesome Smart Client Applications!!
Happy coding!