Silverlight Hack

Silverlight & related .NET technologies

About Me

My name is Bart Czernicki.  I have been working with computers since 1988 and have over 12 professional years in the IT field focusing on architecture, technology strategy and product management.  I currently work as a Sr. Software Architect at a large software development company.

Below is the cover of my new book that shows how Silverlight's unique RIA features can be applied to create next-generation business intelligence tools

Buy the book on Amazon

Contact: bartczernicki@gmail.com

View Bart Czernicki's profile on LinkedIn

NONE of the comments or opinions expressed here should be considered of my past or current employer(s).  The code provided is as-is without any guarantees or warranties.

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

RecentComments

Comment RSS

Top 10 Reasons why HTML 5 is not ready to replace Silverlight

Note: I know this topic is controversial, so I want to preface that this article is meant to be a conversation.  If you don't agree with something or I have information incorrect, please add a comment or e-mail me.  As the HTML 5 spec evolves, I will update this article.

HTML 5 is the next update to the HTML standard that powers the web.  There are many new exciting features being added like the the canvas element, local offline storage, drag and drop and video playback support.  HTML needed to evolve and added these features in order to stay relevant as the de facto markup language that can provide a rich web experience. 

This upcoming featureset is encroaching on areas dominated by RIA (Rich Internet Application or Rich Interactive Application) frameworks like Flash, Silverlight and JavaFX.  Unlike most RIA frameworks, HTML is not a proprietary language/framework and its standards are maintained by the World Wide Web Consortium (W3C).  This has led speculation that HTML plus the new RIA-like features can spell doom to proprietary RIA frameworks.  This article aims to cover what is in HTML 5 (as of February 2010) and how some features in the spec are lacking compared to RIA like Silverlight.  This is not a complete overview of HTML 5, nor is it a "HTML 5 vs. Silverlight" article.  Below is a quick list of items that I will be covering to try to prove my assertion that HTML 5 is not ready to replace RIAs like Silverlight:

  1. HTML 5 is not here...Yet
  2. Audio and Video Tag limitations
  3. Web Browser Compatibility
  4. Javascript Limitations
  5. Productivity
  6. Only targets the general Web
  7. No hardware acceleration
  8. No webcam or microphone device support
  9. HTML 5 standard or Google/Apple spec?
  10. HTML 5 is already behind Silverlight
  11. No Pub-Sub Model (updated 2/28/2010)

1) HTML 5 is not here...Yet

There are some really nice demos appearing of certain HTML 5 features (HTML 5 capable browser required like Safari, Chrome or Firefox 3.x).  As you can see, HTML 5 is very capable in creating RIA-like experiences:

A very large majority of current "HTML 5 demos" center around three key features: the new canvas, audio, and video tags.  The HTML 5 spec is MUCH larger than this.  For example, look at how many differences there are between HTML 4 and HTML 5.  However, many people (including technologists and developers) see one or two demos called "cool HTML 5 demo" and clamor on Twitter that RIA frameworks are gone.  If you dig down deeper, only a small fraction of the HTML 5 spec is implemented in some of the browsers.  Furthermore, the HTML 5 spec is still evolving (You will see some examples below of changes that have occured in the last few weeks).  Some have speculated it might take three to five years to implement the "full" HTML 5 spec once it is finalized.  Will it take that long?  I think companies like Google and Apple who have a very strong vested interest in moving HTML 5/WebKit along are going to push this faster.  However, the HTML 5 spec has to be finalized FIRST (to see the full scope of the implementation) before we can speculate on how long the undertaking will be.

Some of the new demos and features are great to play with.  However, I would be very hesitant to start rolling out HTML 5 features until the spec is finalized.  Most likely we will see the HTML 5 spec implemented in piecemeal over multiple releases.  In two plus years we should see browsers with taglines of "full HTML 5 compliant".  Until then, don't get caught up in the hype...HTML 5 is not here yet!

Note: Browsers like Chrome and Safari (based on WebKit) will probably implement features together in the WebKit framework and they will flow through into the browser.  I would bet on Chrome, Safari and Firefox to lead the charge in HTML 5 spec implementation.
Update 2/17/2010: This is a great article on the problems with the HTML 5 spec.  A great point by the author on how some engineers are accusing others of "sabatoge".  I particularly like the comment by Dorian Taylor about the heavy dependency on Javascript (which I go into detail below) that is a problem with HTML 5.

2) Audio and Video Tag Limitations

One of the biggest additions to the HTML 5 spec is the audio and video element tags which allows you to embed media files directly into the HTML markup.  This allows you to use these media files very similar to the way you would use the the img tag for example.  Providing the location of the resource is all that is required (Additional attributes allow you to create the behavior of the media elements such as streaming).  This is a simple and standard way to enhance your HTML with media files.

HTML 5 video tag markup from W3 Schools

I think HTML takes the right step with the audio and video tag additions.  However, providing a great multimedia experience is more than just playing a video file or a music mp3.  Here are some limitations of the audio/video elements and how it compares to Silverlight:

  • Realtime manipulation/inspection of audio files is not possible.  You can set some additional options like autoplay or buffering; however, you cannot manipulate the audio stream and provide your own equalizer changes.  Flash and Silverlight both can do this.  The HTML 5 audio tag will simply not suffice for more advance scenarios.
  • Limitations of the video tag (similar to audio tag).  You can set options like autoplay or buffering but more common and advanced features are missing.  In Silverlight, you have a wide array of options like applying shaders directly to the video and smooth streaming in HD 1080p.  These options allow you to provide a much richer and advanced video viewing experience.

HD Silverlight video with a 3D transformation and pixel shaders applied in real-time (from Mix 2009 conference)

 


  • No DVR-like/smooth streaming capabilties.  Creating a video viewing website like YouTube is possible in HTML 5.  In fact, Youtube is experimenting with delivering its own video content via HTML 5.  However, if you want to create a rich DVR-like experience with live video, you need a technology like Silverlight.  Silverlight's HD smooth streaming allows for picture in picture, pausing live video, rewinding, slow motion and downstreaming when bandwith slows down.  With smooth streaming, the buffering is minimized and you can jump to different spots of the video almost in real-time.  You can try the Silverlight smooth streaming experience here (Notice how the experience is better than just a simple YouTube video). This technology is so poweful that Silverlight smooth streaming is being used by the NBC Olympics and Netflix to provide HD video in 1080p to tens of millions of consumers.   This is the difference between a one-way stream from server to host (i.e., HTML 5 progressive download with simple stop, pause and play) and a two-way stream the viewer can interact with (i.e., the DVR-like experience).
    • Note: Providing an engaging experience to users is a huge deal.  Users who use DVR-like functionality watch three times more video than users who do not.  What does that mean?  Web sites that use a more engaging technology keep the viewers at their site. This is not limited to just Silverlight.  For example, MLB.com provides a very similar experience using Flash with HD add-ons.
  • Content protection/DRM does not exist in the video tag in HTML 5.  This is a huge problem for hosting copyright or sensitive content that you don't want viewers to copy or save to their hard drive.  Can you imagine Netflix using an HTML 5 video tag for a new Hollywood movie and everyone were able to save a copy to their hard drive?  Until this changes, the HTML video tag will only be used for non-sensitive media.  Silverlight supports a variety of digitial rights management architectures/encryption options.
    • One simple test is to go on YouTube and play a movie.  Next, go to your temporary internet files folder and find a file that was generated around the time you watched the video (It should be one of the largest files).  Rename that file to an .flv extension and the file is yours.  This is possible because progressive download temporarily stores the video file on your hard drive.  This makes simple tools like downloadyoutubevideos.com possible.  As you can see from our simple little test, this simply will not fly for any commercial media.

Note: Silverlight is not the only technology that offers smooth streaming.  Apple's Quicktime Streaming and Adobe's Flash Media Server are two examples of technologies that offer streaming and DVR-like capabilities.  It is worth noting that Silverlight Smooth Streaming is a FREE value-add to Windows Server 2008 IIS 7.x.

 

3) Web Browser Compatibility

The HTML 5 spec is partially supported by the latest versions of Safari, Chrome and Firefox.  Internet Explorer from Microsoft is the key browser missing HTML 5 support.  The fact remains that Internet Explorer is still one of the most widely used browsers in the world.  Designing a site without Internet Explorer in mind would probably not be a great idea.  Isn't evil Micro$oft simply blocking innovation?  I don't think so.  Internet Explorer 9 is rumored to have HTML 5 support.  Furthermore, Microsoft would further degrade the use of Internet Explorer if they simply decided to skip the HTML 5 standard.  No matter what your open-source/Linux fanboy tells you, that won't happen.

Let's say the next version of Internet Explorer comes out and it supports HTML 5 tomorrow!  As an architect/CTO, are you going to design a new web site in HTML 5 with over 66% of the web running Internet Explorer 6-8?  There are so many web connected devices out there that simply will not support HTML 5 for a long time.  Remember web connected devices include mobile phones as well.  Furthermore, many casual users (like your parents) may not upgrade their browser for the entire lifetime of the "family computer".  Furthermore, the HTML 5 specification is pretty big and different browsers support various features.  You can see from this Wikipedia article that no current browser supports the current HTML 5 spec (because it is still evolving).

 

Internet Explorer is losing its dominance. However, even a 10% drop would be equivalant to hundrends of millions of users stopping use of Internet Explorer.  I don't see a 20% drop until two to three years from now.  You can check out the web browser trends for yourself: http://statowl.com/web_browser_market_share.php

Note: Providing fallback markup is a valid option; however, this leaves yet another architecture/code path to put through QA.  That works great for sites that are template-based (like YouTube).  However, creating a large scale business app with fallback markup has a large cost associated with it.

 

4) Javascript Limitations

If you have done any sort of web development, you have probably used Javascript to provide dynamic content on the client browser.  The same applies for manipulating HTML 5 content.  So what is the problem?

  • Javascript does not provide a true parallelism.  Today's desktops and laptops come with two to four available cores.  Even future iPhone specs plan for multiple cores.  How can you rely on a language/framework that can't take advantage of all available cores?  Silverlight's .NET framework can scale up to eight processor cores.  You can see my two previous articles on how this makes a pretty substantial difference in performance.
    • Note: Web Workers for JavaScript will eventually provide the ability to utilize multiple threads.  The problem is that Javascript is a hybird between a imperative/declerative language.  For example, parallelizing for loops is not going to be possible without a re-write.  In .NET, I can use LINQ/F# or other declarative techniques to easily parallel multiple tasks.
  • Javascript is a cross between a functional and object-oriented language.  It implements only some of the functional and object-oriented language features.  The great thing about being based on the .NET framework is that Silverlight dynamic content can be created using C#, VB.NET, F#, and Iron Python (dynamic langauges).  This gives you tremendous flexibility and functionality that Javascript simply does not provide.  You can chose the right language for the task.  Some languages provide features that others do not (even in .NET).  For example, take a look at my asynchronous workflows in Silverlight with F# article.  
  • Javascript limits code sharing.  Do you have any server component code written in Javascript?  Stupid question, right?  However, if you are a .NET shop, you probably have business rules engines or components written in a .NET language.  The great part about this is that this code can be distributed to the Silverlight client.  Another example of sharing Silverlight code is with WPF.  Because both technologies have a lot of synergies, a large majority of code can be shared between Silverlight and WPF.  In the near future, this will be expanded to Silverlight Mobile as well.
  • Javascript is not the fastest framework.  There is not much to be said here.  There might be some minor exceptions but a well-written JavaScript application will almost always perform slower than a similarly written .NET Silverlight application (If anyone has examples that differ, please share).
  • Code Security.  Javascript suffers from the fact that the code can easily be inspected using just the browser (page -> view source).  Silverlight suffers a similar fate.  However,  Silverlight code is harder to inspect.  You essentially need to find the cached assemblies and use a tool like reflector to dissasemble them (Silverlight Spy is another tool that can inspect Silverlight code on the fly). However, as mentioned before, a person that wants to reverse engineer a Silverlight app has to go through more steps.  If you must deploy Javascript or Silverlight code on the client, always use an obfuscator and make the hacker work harder. :)
    • Note: As a rule of thumb, any code that you consider IP should not be placed on the client. 

5) Productivity

In this article, I define productivity as a set of architecture and design tools, add-on frameworks, and developer tools that makes me more efficient in crafting and maitaining an application.  HTML, CSS and Javascript suffer from a wide variety of productivity problems.  Have you used a web tool that does everything for you on a complex project?

  • HTML and CSS problem. CSS is language that allows you to enhance HTML with styles.  The combination works great in theory.  However, as the web has evolved to more "fluid HTML/CSS" designs (i.e., div tables with CSS), the web tools have struggled to catch up.  Furthermore, browsers like IE not supporting all of the CSS 2.x standard has led to cross-browser compatibility issues.  This has led to developers having to jump around manually getting their hands dirty in CSS (While that is not bad, it's not productive).  CSS is not a pretty language and large stylesheets are a MESS to work with.  For example, try looking at the CSS for SharePoint 2007.  This has been solved by creating CSS Metaframeworks that allow for cool features like CSS style inheritance which translates to smaller, more maintainable CSS.   Which web design tool that you use integrates with a new open-source meta framework?  Sure, the preview might work; however, you are still manually editing CSS in the end.
  • I can do anything that Silverlight can do with [insert web framework here]. I recently got into a debate with a web developer about Silverlight.  All the things I was listing Silverlight can do, his reponse was, I can download "this open-source framework".  Want to improve HTML DOM development? jQuery.  Need a declerative query language like .NET LINQ? jLinq.  How about a Javascript charting package? JS Charts. By the time we were done, his application included five to six additional frameworks.  I find this a productivity problem for a several reasons:
    • Open source/commercial javascript frameworks rarely integrate easily with web design tools (Some frameworks like jQuery that are hugely popular have enterprise tool integration like in Visual Studio 2008/2010).  An add-on framework will help productivity; however, the developer is not working in a design tool 100%.  Therefore, they are not being as productive as they can be.
    • Designers cannot design.  This makes the entire process of web design much harder for non-developers.  A designer should work in a design canvas and have the end result automatically translate to the markup language and pass this off to a developer for interactivity.  How is this possible with HTML/CSS/Javascript not being standardized in simple design tools?
    • Add-on framework maintenance.  On large-scale projects having to juggle multiple add-on frameworks can waste a lot of time.  For example, picking the correct framework, ensuring licensing is compliant, is the framework going to be maintained in the future, etc., are all tasks that need to be handled by someone.
  • Cross-browser issues.  Cross-browser issues are still a huge problem even for large companies like Google who announced this year they are phasing out Internet Explorer 6 support.  There isn't much to add here.  However, if you are a web developer and have not faced these issues, I would like to meet you. :)
  • Control/UI component development. Support for creating reusable UI components in Javascript is virtually non-existant.  It requires developers to be involved and write Javascript that crafts dynamic HTML.  For example, how would you create a Javascript control that renders a gauge?  
  • Integration with server technologies. Working with technologies like ASP.NET or PHP adds another level of complexity to HTML.  This further degrades productivity, by having to manage local client state between server calls (i.e., cookies, temp cache).  Tools like Visual Studio do a very poor job in making a designer feel like home when having to integrate server/client technologies together.

The Silverlight framework handles the productivity issues in a cohesive set of tools that include design tools, developer tools, and a rich .NET foundation.

  • Many architectural/code patterns can be leveraged using .NET:  MVVM/commanding design pattern is built into Silverlight 4, MEF allows for loose coupling of components, Silverlight Unit Test framework, LINQ (declerative query framework for data structures), asynchronous programming model, functinal language support like F#, etc.
  • Silverlight and the accompanying control toolkit include a ton of controls that can be easily extended or styled.  (Toolkit is open-source).
  • Advanced media capabilities like encoding an HD smooth streaming video and providing a DVR-like experience to the viewer can all be done with Expression Encoder and the Silverlight Media Framework.
  • Developer productivity is powered by Visual Studio 2008/2010 and the Silverlight framework.  Debugging parallel tasks in Visual Studio 2010 is easier than ever.  If you want to know if your application is taking advantage of GPU acceleration, Silverlight can highlight the areas affected!  Furthermore, helpful tools like FPS counters are all built into the framework.
  • Design in Silverlight is done using Expression Blend.  This tool can be used by both designers and developers to create UI controls, interactivity, and transitions easily in a single form.  The combination of design features like Sketchflow, behaviors, design-time data and visual state manager allow designers to design without writing code.  These tools allow designers to perform tasks like applying a pixel shader to a video, adding physics (gravity) to an object, and being able to create design-time data representations without writing any code.

Expression Blend Sketchflow allows designers to prototype applications with data, interactivity, and transitions without writing code.



I could add a lot more to this topic.  However, my experience on working on Silverlight has been "night and day" in terms of productivity.  Projects I have worked on allowed developers/designers to seemlessly create complex controls and extend existing ones and create very unique product designs.  The combination of Silverlight frameworks/tools and what you gain from .NET makes it a pleasure to work with compared to HTML/Javascript/CSS.  The tools that accompany the HTML 5 spec have to truly go through a revolutionary transformation in order to keep up with the design experience provided by Silverlight and Flash.

Note: I have a friend who recently got laid off from a "large" video game studio...pretty talented C++/graphics developer.  With the game industry hurting he moved onto web development/databases/services...regular business stuff.  He told me the same "mess" that occurs with video game development is the same thing he hates about web development.  Having to juggle between different graphics programs, exporting assets editing shaders, code etc.  was analogous to him with having to jump between ASP.NET, Javascript, CSS, HTML etc.  I thought this was a great analogy.

 

6) Only target the general Web

HTML 5 is a markup language for the web.  You essentially need a web browser to interpret HTML content.  Silverlight allows you to write once and deploy to desktop, web and now Windows Phone 7/Symbian/Android.  Additional features like multi-touch features allow you to take advantage of next-generation hardware natively, without having to rely on the browser.

Note:  I realize that technology like Mozilla's Prism allows for "installing" HTML/Javascript sites locally on the desktop.  But that technology is not very popular and I haven't met anyone that uses it widely commercially,


7) No Hardware Acceleration for Graphics (GPU support) or 3D support

The current HTML 5 spec does not have support to offload rendering to the GPU.  There are plans to support it in the future with WebGL technology using the HTML 5 canvas.  WebGL should provide 3D, hardware-acceleration, and pixel shaders to HTML/Javascript.  Silverlight (as of Version 3) already supports 3D projections, hardware-acceleration, and Pixel Shader 2.0.  Furthermore, the GPU acceleration is not limited to just one layout control (canvas in HTML5).  There are also many physics and 3D engines out there for Silverlight.

The screen shot below is from a chapter in my book that shows a piece of XAML layout that was GPU accelerated.  As you can see, GPU acceleration does free up noticable CPU resources.

One of the ugly parts of the WebGL implementation is that you are still using Javascript to provide dynamic content to the 3D Canvas.  I can imagine this being passable for simple 3D demos, but it won't work for complex interactive 3D scenes.  Doing complex 2D/3D vector math or matrix computations in Javascript isn't going to perform well.  For example, some military simulations for the HUD of a cockpit use a Flash UI for training.  Rendering these complex visuals and providing real-time event-driven calculations is important.

Broad WebGL support is probably a ways off as the spec is still changing.  The future Firefox 3.7 release will suport WebGL/3D Canvas. Other browers like Chrome and Safari will get support as well via the WebKit compatibility.  I would estimate we should see decent WebGL support for Chrome, Firefox and Safari in one to two years.  The reason why I think it is still a year (or two) away is because there are major revisions yet to be implemented and tested.  Furthermore, WebGL is an extension of the HTML 5 canvas.  Therefore, it would make sense that once the canvas tag has matured, WebGL will probably have some upcoming changes.


8) No Webcam or Microphone Device Support

Providing device support integrated into the browser is a huge deal for social, collaboration, and media applications.  Web cam and microphone device support is becoming a big deal for mobile applications as well.  The HTML 5 spec does not support these devices.  There is a plan to add device support in post HTML 5 (5.01 or 5.1, etc.)  Conversely, Silverlight 4 supports both of these devices.

Augmented Reality Applications (shown below), web conference/chat (chatroulette.com), or real-time photo manipulation (and more) applications can all be done with Silverlight 4 device support.  (As the HTML 5 spec stands now, these types of applications cannot be done natively with HTML/Javascript).

Rene Schulte's great example of Silverlight 4 augmented reality

 

9) HTML 5 standard or Google/Apple spec?

A large majority of the HTML 5 spec is being pioneered by the Google and Apple engineers; not that this is a bad thing.  However, note that both Google and Apple do not have RIA or popular graphics frameworks.  They have to do something and have a very vested interest in HTML 5 coming out ASAP.  Rather than creating their own RIA-type frameworks, they are trying to evolve the HTML 5 spec to compete with the rich RIA web experiences.  Here are a couple of interesting points to think about:

  • Do you trust Google to evolve the spec "the right way"?  Google has this aura of being the "not evil corporation" which you would be naive to truly believe.  Will they push for a HTML 5 spec that is serving their own services/technology roadmap or pioneer changes for the greater good of the web community?
  • Adobe is a wildcard here.  What if Apple purchases Adobe? (This acquisition makes sense on many levels).  Will Apple still be as vested to evolve the WebKit/HTML 5 spec?
  • Apple has a proprietary/highly locked down framework with the iPhone/iPad SDK.  What if they decide to use that as the next RIA alternative? You have the same framework on smart phones/tablets; why not move it to desktops?
  • Will Apple/Google alienate other companies like Microsoft, SAP, Oracle, IBM with the way the spec evolves?
As you can see here from this article/chart, Google and Apple are #1 and #2 in evolving the WebKit spec.  In this article, I referenced the HTML 5 spec numerous times.  Notice how a large majority of the spec "owners" are Google engineers.

Update 2/21/2010: Looks like Google has officially scrapped evolving Google Gears (the HTML RIA-like framework) in favor of the investment in HTML 5.  BTW Ian Hixon (the "owner" of the HTML 5 spec from Google's end and some would say the entire HTML 5 spec) was the one that said "Adobe was blocking the spec".  So no one can object the HTML 5 spec if it doesn't support Google's plans?  See where this can get really bad?

10) HTML 5 is already behind Silverlight

This is the last point, however the most important.  After reading all of the "new" HTML features like: video tag, audio tag, canvas, Web Workers, WebGL, future device tag support etc. you should have realized that HTML 5 is JUST CATCHING up to Silverlight.  Furthermore, the HTML 5 spec is not close to being implemented. Lets assume that the full HTML 5 spec is implemented in 2 years (assuming a very aggressive schedule)...where will Silverlight be by then?  Silverlight is on about a 9 month release cycle.  Therefore, by the time HTML 5 is "implemented"...Silverlight will be on version 6 or 7of the platform.  HTML will have to play catch up....again.

11) No good pub-sub model

The current web is built upon the request response architecture.  You navigate your browser to a domain or a service URL -> click go -> receive a response payload.  Once you are done the content is static.  What if the server has new/updated content?? Additional Javascript can be run in order to update the content (make an Ajax call) or the user can manually click a link or refresh the content.  This works, however it is slow and prone to a lot of additional code.  For example, if you have watched a gamecast/box score of a live sporting event you have probably seen a client-side timer refresh (shown below).

ESPN refreshes their gamecast content with timers initiated from the browser client:

 

 

The client calls (even if they are automated) have to be initiated by the client, hence the name: request response. 

Wouldn't it be better if the client could "subscribe" to the content offered by the server? This way anytime the server's content has changed it would automatically send the update to the clients that have subscribed.  Silverlight has great support for the pub-sub model that runs on the net.tcp protocol as well as WCF duplex polling.  The performance increases are tremendous (thousands of percentage points).  Pub/sub is another great option for the Silverlight architect/developer. (A great article on using the WCF net.tcp binding with Silverlight 4 can be found here).

Note: HTML 5 is supposed to include something called web workers, which are going to add pub-sub capabilities to web applications.  More info can be found here. (As mentioned several times before, there are other competing architectures in the spec waiting to be ratified which makes this more of a mess).

 

 

kick it on DotNetKicks.com 
Posted: Feb 08 2010, 10:31 by Bart Czernicki | Comments (20) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight | Silverlight 3
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Are you ready to learn F#? Concepts to be familiar with before learning the F# language

I have been learning, absorbing and playing with F# for several months now.  I worked primarily with C# since 2002.  I figured I would write some .NET and developer concepts that one should be familiar with before trying to learn F#.  Hopefully, the list compiled below will help you determine if you are ready to learn F#.  If you are not familiar with most or any of these items below, it doesn't mean you can't learn (or shouldn't learn) F#.  However, in my opinion, the more you know from the items listed below, the easier it will be to learn the language.

Background Information

F# is a new functional programming language (from Microsoft) that is being released with .NET 4.0 and Visual Studio 2010 in March 2010.  The language is a "first-class" language and is completely integrated with the entire .NET ecosystem (debugger, tools, framework, support) like C#, C++.NET and VB.NET.  Therefore, F# is not like Delphi.NET, COBOL.NET or other third-rate .NET languages.  Functional languages are based on mathematics and this makes them ideal for statistical, financial operations on large data sets.  F# is a unique .NET language that will have many uses in the near future.

Programming Concepts

This is a list of programming concepts you should be familiar with before learning F# (Note: I ommited a lot of beginner programming concepts). You will see a lot of these concepts/patterns used in F# programs and examples.

  1. Data Structures - You should have a good understanding of the differences between a linked list, array, hash set, etc.  F# natively uses certain data structures (in underlying types) and knowing the differences between them will aid you when writing programs.  If you need a refresher, check out this FREE PDF book Data Structures and Algorithms Book.
  2. Big Oh Notation - You have to be able to understand the performance implications of your algorithms.  This is especially true for functional programming languages like F#.  If you do not know the difference between O(1) or O(n), you need to refresh your memory.  This is important when writing functional (non-imperative) style programs when doing many operations on a sequence or list of types.
  3. Type Inference - By default,  the F# compiler uses type inference to determine what types a function uses.  C# has partial type inference using the var keyword.  However, in C#, you still need to pass in the type explicitly for method signatures.  Being used to not seeing these "type aids" will help you understand F# syntax faster.
  4. Immutability -  In object-based languages such as C#, C++ or VB.NET the created objects are mutable.  This means that their state can be changed.  Functional programming languages are by default immutable and do not allow the state of the value/variable to change after it has been assigned a value.  For more information on immutability go here.
  5. Recursion - Recursion is the ability of a piece of code to call itself over and over until the desired result has been completed.  In C#, methods can be recursive.  In SQL (SQL 2005), a developer can use CTEs (common table expressions) to recursively iterate through the same algorithms.  This pattern is very popular in functional programming and whatever F# book you pick up, this will be one of the first chapters you read.  If you are familiar with the more advanced topic of recursion like "tail recursion," that will be really beneficial as well.  For more information on recursion, click here.
  6. Closures - Closures are a more advanced topic that most developers use every day without even knowing it.  Closures allow you to use constructs that are declared outside of the scope of the function as if they were part of the local scope.  I recommend Jon Skeet's book to fully understand them.  A link to an article on his website can be found here.
  7. Currying -Function/method currying is the process of creating new functions/methods from existing functions/methods and their parameters.  You will see function currying in a lot of F# examples as it makes code simpler and easier to read.  For more information on currying, click here.
  8. Iterator pattern - I think this is one of the more important design patterns.  For example, as a .NET developer, you should know the difference between a List type and an IEnumerable and how to use the yield keyword to implement the iterator pattern in C# (In F#, an iterator is implemented in a sequence).  As mentioned above, functional programming languages are designed to work with lots of data.  Therefore, optimizing data structure access is essential to create performant F# modules.  For a great article on the iterator pattern, please look at Juwal Lowy's MSDN article.
  9. Asynchronous Programming - Since F# is by default immutable and tries to get the developer to program without side effects, this makes it great for asynchronous programming.  The reason is that by definition, all constructs should be thread-safe since their state cannot change.  Knowing about async programming helps, but it does not mean you can't do synchronous F# programs.
  10. Writing Clean Code - In my opinion, this is probably the most important one of all.  When writing C# code, you have curly brackets and semicolons to aid you in laying out your code and determining scope.  However, in F#, the way you lay out code matters!  This means whitespace and bad code formatting could create unwanted bugs.  The reason I mention this as important is that this could be a hard habit to break.  For example, learning about closures could take a very small amount of time compared to breaking a bad habit in formatting your code.
  11. Other functional languages - This is an obvious one. If you have experience with other functional languages such as Haskell or OCaml, you will obviously feel right at home with F#.

.NET/C# Concepts that Translate to F#

This is a list of .NET/C# concepts that translate well into F# and will help you understand functional programming more easily.

  1. LINQ/SQL - If you have used LINQ or SQL, this will dramatically help you understand how to write functional algorithms.  LINQ/SQL favor declerative (opposed to imperative) syntax like F#.
  2. Lambda Syntax - If you are familiar with lambda syntax in C#, you will see a very similar lambda syntax in F#.
  3. Extension Methods - This could be associated with knowing LINQ but it is worth mentioning here as extension methods are essential in "fluent" code.
  4. Generics - Generics were introduced to the .NET framework to aid in code reuse.  In the same manner that you can write a generic method in C#, you can write a generic function in F#.
  5. Delegates and Simplified Delegate Syntax - If you have used delegates as parameters or to pass pieces of code around, then the functional composition concept will be familiar to you in F#.  You can read my Evoloution of C# Delegate Syntax article to understand how delegates allow you to write code in a more functional paradigm using C#.
  6. Parallel Task Library/PLINQ - Writing algorithms that can take advantage of many cores should not be hard.  This is exactly what the Parallel Task Library/PLINQ allows you to do in .NET 4.0 in a simpler, functional way.  These concepts are closely aligned to F# asynchronous workflows which allow concurrency (even in Silverlight!!)
  7. var Keyword (type inference) - Being familiar with the var keyword in C# will get you familiar with type inference in F# faster.  Most F# examples make use of this feature and declare types explicitly only when needed.

Summary

If you read reviews of available F# books, some are negative - in my opinion, unfairly - because the developers expect to be taught everything.  There are a lot of core concepts listed above that a single F# resource simply cannot cover.   Understand when purchasing F# resources, you are expected to know a decent amount of these developer topics.  I hope this list aids you in the way you approach learning F# either by jumping into F# directly or by brushing up on some intermediate/advanced programming concepts.

Getting started with F#

Information on F# has been around for several years.  There are many articles, white papers and books on F#.  However, you do have to be careful and get content that is recent and relative to the current F# release.  The F# specification has changed dramatically over the last several months as the language was being "productized" and many methods/functions simply don't exist in F# anymore.   Below are some links I put together where to get started.

Videos

  • Getting Started with F# - This video (from the 2008 PDC) is the place to start if you have zero F# experience and/or if you want a really good introduction into functional programming and some F# examples.

Books (I have read four different F# books and the two below are by far the best ones and most current.  Don Syme's F# book is good but a little outdated.)

Websites

  • http://www.fsharp.net/- This the main Microsoft F# page.  Includes numerous links, downloads for Visual Studio, F# extensions, etc.
  • Don Syme's blog - Don Syme is one of the main "creators" of F#.  His blog is a must read to get insight into advanced topics and upcoming F# news.

 

kick it on DotNetKicks.com
Posted: Dec 06 2009, 12:29 by Bart Czernicki | Comments (6) RSS comment feed |
  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .net | F#
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Solution Composition in Windows Azure Cloud Service Project Template

Goal: This blog post aims to show you the new solution composition feature in the "Windows Azure Cloud Service" project type.  In addition, I posted some additional thoughts on how this could be expanded as a very useful starting point for all projects.

The new "Cloud Service" project template includes a new feature (This is my name until Microsoft officially names it) "solution composition".  In Visual Studio 2010 Beta 2 (if you install the Windows Azure SDK), you will see a new Cloud Service template.  Through the screen shots below, I am going to highlight some of the key features of "solution composition". 

Cloud Service (Azure) Project Type



Selecting the Cloud Service template brings up an additional dialog box that allows you to add a number of additional project types.  Currently VB.NET, C# and F# web role and worker role projects are supported.  Selecting the project and selecting the arrow button adds this project to the Cloud Service solution.



If you need several projects of the same type, you can add multiples of the same type.  Notice the screen shot below illustrates a solution with three seperate C# worker role projects (assemblies).




Once added, project names can be renamed or removed.  Red arrows below highlight the controls that allow editing of a project.




After clicking the OK button, a complete Cloud Service solution is created with all the projects properly added to the roles folder.




Why Does This Matter?

If you have architected large-scale n-layer prototypes or projects, you can clearly see the benefit of "solution composition".  This allows you to select the projects you want ahead of time and "compose" a single solution.  For example, imagine you want to create a Silverlight application with a WCF service.  You might start with a Silverlight ASP.NET project type.  However, then you need to manually add all the projects yourself and properly add the references between them in Visual Studio (i.e., WCF service project, BLL assembly, DAL assembly, LINQ to SQL dbml, Silverlight BLL, etc.).  It would be much better to simply select the projects that will compose your solution and have Visual Studio generate the whole solution. 

 

Solution Composition Features I Would Like to See

The Cloud Service template in Visual Studio 2010 Beta 2 is a step in the right direction; however, it can be greatly improved.  These are some of the items I would like to see:

  • Make "solution composition" available for all Visual Studio 2010 templates.
  • Allow the architect/developer to build a dependency/reference tree between projects.
  • Integrate the solution folders feature (Allows you to logically organize the solution).
  • Allow the architect/developer to add specific functionality to a project.
    •  For example, if I want to have a DAL that uses LINQ to SQL, the ability to "checkbox off" and add a LINQ to SQL class
  • Allow the architect/developer to specify the assembly references for each project (.NET, custom toolkit, etc.).
  • Include a "smart namespace naming" feature.  Assemblies are named namespace+project name.
  • Ability to save the entire "solution composition" as a template itself for future use
    • Integrate with TFS and replicate to all developers (?)
    • Add diagraming feature

How Useful is This?

After reading this, you might be thinking that this is overkill and how often are you creating "large solutions".  If you have prototyped a lot of solutions, this will be a Godsend.  Furthermore, a lot of consulting shops that have to quickly generate client-specific prototypes would greatly benefit from this feature  In my opinion, the more tedious (plumbing) tasks that are automated, the more I can focus on architecture or design of software solutions.

kick it on DotNetKicks.com
Posted: Nov 15 2009, 16:27 by Bart Czernicki | Comments (3) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Azure | Visual Studio 2010
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Connecting to SQL Azure with SQL Server Management Studio 2008 R2

Goal: Show a user how to connect to a SQL Azure Server from SQL Server Management Studio 2008 R2.  If you don't have a SQL Azure account you can treat this post as information to further your knowledge about Microsoft cloud storage

As of 11/10/2009, SQL Server 2008 R2 is feature-complete as well as SQL Azure.  The new version (PDC 2009) of SQL Azure has been provisioned on all of the production servers.  The current version of SQL Server 2008 R2 available is CTP which is a publicly available beta of the Enterprise Edition (Note: Enterprise Edition is not the highest edition anymore.  Since SQL 2008 R2, Microsoft has added Premium Editions that allow for massively-scalable database servers).

What you need to follow along:

- SQL Azure Account (active)

- SQL Server 2008 R2 Management Studio Installed (Download just the Management Studio tools here)

For the initial release being shown at the PDC 2009, SQL Azure includes some new configuration features that need to be enabled in order to connect:

  1. Log in to http://sql.azure.com with your account information

  2. Go to the SQL Azure tab to access your projects (If one doesn't exist, create one.)

  3. Click on the project row to access the SQL Azure Server Administration screen.


  4. If you do not have a server SQL Azure server provisioned, you will be asked to create one.

  5. In the SQL Azure Administration Screen you can
    1. Drop/Re-create a server
    2. Reset the admin password
    3. Get a connection string to the database server
    4. Test the server connection (send a connection ping)
    5. Manage your databases
    6. Change the Firewall Settings


  6. Create a sample database and click the "Test Connectivity" button to ensure you can connect via the network/firewall to the remote Azure server.  This step should be done to make sure that you do not have any network or firewall issues.  Furthermore, this ensures that the server and database were properly provisioned in the Azure Cloud and are fully functional.




  7. Open SQL Server 2008 R2 Management Studio and in the Server Name text box, enter the name of the SQL Azure Server from the Server Administration screen (Shown in Step 5).  Make sure you copy the fully qualified DNS name (as shown in the screen below).  Ensure that the Server Type is set to Database Engine and the Authentication is set to SQL Server Authentication.




  8. Try connecting by hitting the Connect button. If you get an error similar to the one shown below that states your IP does not have access, you need to configure your SQL Azure Firewall settings.
    1. SQL Azure (as of the October 2009 version) includes Firewall Settings manager that allows you to explicitly control which IP addresses are allowed to connect to your Azure database server.  This was done to alieviate customer concerns regarding placing sensitive data on Microsoft's server.  If you specify that only your network can access the database server, this gives you more piece of mind that a hacker hasn't hijacked the user/password and can connect.  Furthermore, it is more secure and a best practice to do this.




  9. In order to fix this, we simply need to allow the IP address you are connecting from in the Firewall Settings manager.
    1. One question you may be asking is, what do I do if I have a dynamic IP"?  For example, if you have a broadband connection such as DSL or FIOS, your IP address can change over time.  This would be really annoying if you had to add a firewall exception every other day!  One way to get around that is to find your ISP's IP range and enter that in the exception.  It is not as secure as providing a single static IP address however.  It is much more secure than opening up SQL Azure to the entire Internet (full range of IPs). Most ISPs will provide the range for your area if you call them.  Some even publish this information on their knowledgebase/support.

  10. Go back to the SQL Azure Server Administration screen and click the Firewall tab.  Clicking the Add Rule button will bring up a model popup where you can enter the name of the Firewall rule and enter either a range of IPs or a single IP:
    1. The popup lets you know what your current IP address is.  You can simply copy and paste it into both locations.  You can enter as many locations as you need.  For example, you may have a home network, wireless card with an IP range, work network, etc.
    2. If you have an ISP that has a dynamic list of IPs, enter the IP range that was provided to you.
    3. This is NOT recommended, but you could add a rule that opens up the entire IP stack of the Internet by entering 0.0.0.0 -> 255.255.255.255
    4. If you are not comfortable with an IP range, another solution is to use a "proxy service" and this will masquerade your IP to something else.  Static IP addresses cost money; however, they can be useful in these situations.
    5. The dialog mentions that it could take up to five minutes to connect. I tried this several times and after one minute, you should be able to connect.




  11. You should be able to open up SQL Server 2008 R2 Management Studio and connect to your SQL Azure database. If you are successful, you will see your database in the Object Explorer (shown below)

  12.  

 

Conclusion

You should now be able to configure an SQL Azure database and connect to it via SQL Server Management Studio.  Managing a SQL Azure is a little different and in my next post I will show some of the features of managing SQL Azure with SQL Server 2008 Management Studio.

kick it on DotNetKicks.com
Posted: Nov 11 2009, 16:08 by Bart Czernicki | Comments (3) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Silverlight 3 and F# Support in Visual Studio 2010

The goal of this blog post is to make you aware of F# support in Silverlight in Visual Studio 2010.  In addition, this blog post shows an example why F# is going to be very important for Silverlight architects and developers.  Note:  This is NOT an intro to F#.

Demo and Visual Studio 2010 source code are provided with this article.

In Visual Studio 2010, F# is a first-class language.  Over the last several months, the language has been "productized."  It is officially part of the Visual Studio 2010 ecosystem (tools and .NET 4.0 framework).  However, F# is not limited to the full .NET framework; it is also available in the Silverlight runtime.  This is really exciting as this allows you to take advantage of functional programming features in Silverlight.

 

In Visual Studio 2010, the "F# Silverlight Library" project is natively supported.

 

Silverlight 3 application that includes an F# assembly.

  

Why should I care about F# in Silverlight?

Most C# developers/architects who do not have experience with functional programming language features could assume that F# is another language like Visual Basic, J# or C++.  It would be wrong to compare F# to any of these languages (including C#).  As a functional language, F# allows developers to design software using the functional paradigm.  What does that mean?  This means functional patterns such as interactive programming, pattern matching, immutable data types, type inference, lambda expressions, workflows, higher-order functions, discriminated unions, etc., are all included in F#.  While taking advantage of these features, a developer using F# can use the type system, implement object-oriented design and make use of the .NET classes.  This makes F# a very unique language that combines all the features of a first-class .NET language (i.e., C#) and a professional functional language.

Note: F# compiles to IL just like any other .NET language.  However, F# has been designed from the ground up over the last couple of years.  Therefore, the IL it generates has been optimized and many new language optimization features have been implemented.  For example, you may have seen blog posts that compare C# and F# syntax that shows F# compiling into cleaner IL and faster code.  Conversely, C#'s core functionality has not been redesigned in about a decade (C#/.NET has been extended with functional features such as type inference, extension methods, lambdas, AST, LINQ, etc.)

 

Show me some code that proves how F# can add value to Silverlight

This short blog post is not meant to be an F# introduction (Please see links below for intro material).  However, I did want to pick at least one compelling feature that really shows off the power and functional brevity of F# married with Silverlight functionality.  The feature that I decided to show off in a Silverlight F# module is a concurrent programming pattern.

If you do not already know, Silverlight supports distributing logic up to eight processor cores (This frustrates me that Microsoft doesn't adverstise this enough). In my opinion, concurrent programming is THE biggest feature of Silverlight over other RIA technologies (i.e., Flash, JavaFX).  However, implementing asynchronous patterns in Silverlight is not trivial.  The callback pattern is messy and leads to a lot of code.  Silverlight runs in an STA mode and requires UI elements to only be modified by the main thread (dispatching or synchronization).  Even asynchronous constructs like the BackgroundWorker that are supposed to make concurrent programming simple lead to many messy lines of code with events.  Wouldn't it be great to get the benefit of asynchronous programming without having to write many lines of additional code?

One of the fantastic features of F# is that the default type immutability and functional design allows the language to express the desired result declaratively.  This means you write F# syntax by telling the program what you want it to do rather than how to do it.  For example, if you are using constructs that use secondary threads and allocate code to these threads, then you are writing imperative code.  A lot of lines of code are wasted telling the code how we want it to behave.  Wouldn't it be better to define pieces of logic and simply say that we want them to execute in parallel?  Functional declarative code in F# can do exactly that.  F# includes a feature called asynchronous workflows that allow you to write logic by composition with the aim to be executed in parallel.

Initial Steps

  • I created a simple Silverlight application.
  • I added an "F# Silverlight Library" project
  • In the F# assembly, I added an F# code file called ConcurrencyTest.fs.
  • I created an F# function called addNumbers that takes two parameter:
    • The first parameter is an accumulator that is the existing sum in the running sequence (This will be passed by the reduce sequence function).
    • The second parameter is the number in the sequence we want to add.
  • I created an F# function called squareNumber that takes two parameters:
    • The first parameter is an accumulator that is the existing square sum in the running sequence (This will be passed by the reduce sequence function).
    • The second parameter is the number in the sequence we want to square.
  • I created an F# function (equivelant to a C# method) that takes no input parameters named PerformTwoLongRunningTasks:
    • Inside that function, I defined two tasks that use the addNumbers and squareNumber functions to add the numbers across a sequence of numbers from 0 to 10,000,000
    • The PerformTwoLongRunningTasks function returns an array of 64-bit integers.  The array of 64-bit integers are the results of the two aggregates functions.
    • The first function returns the sum of the numbers.  The second function returns the square of the numbers.

The F# static method/function is shown below (Some familiarity with F# is required to understand what is going on, but I commented on the code for those unfamiliar with F#):


Now that we have this function (static method) defined in our F# library, it is ready to be used.  In the Silverlight application, we can add a reference to the F# library and then we can call the function (static method) as shown below in our C# Silverlight MainPage class.  Note that below we are calling the function just like we would call a static method with the [Name of Class].[Name of public function].  Notice also that because F# uses the base .NET type system, the returned array of integers does not need special casting/marshalling to C#.

Parallizing the Tasks

Now it is time to parallize the two tasks and scale it across multiple logical/physical processor cores.  As mentioned earlier, we are going to accomplish this with asynchronous workflows. In the figure below, I highlighted the changes to the function and it now scales across multiple cores.  This was done in two steps:

  • Wrap the body of the member functions with the async {... } syntax.
    • Add a return keyword (This signifies the return parameter/completion of the body).
    • The body of the function Seq.reduce addNumbers {0L..10000000L} now becomes async { return Seq.reduce addNumbers {0L..10000000L} }.
  • The main function (PerformTwoLongRunningTasks) now returns an array of async tasks.  These can be thought of delegates that need an Invoke-type command to execute them.  We simply change let results = [| task1; task2 |] to let results = Async.RunSynchronously (Async.Parallel [ task1; task2 ]).
    • All this does is tells the F# compiler to parallize these tasks.  However, run the result synchronously.  Therefore, the code returns to the main thread and we do not need dispatching/synchornization, etc.  This is analogous to creating a wait event in C# and having the two pieces of logic scheduled on secondary threads and waiting for this process to come back.


Asynchronous workflows allowed us to simply wrap the tasks as an "async function" declaratively.  This is a very important distinction as we just declared the logic and told it we want this to run in parallel.  Notice we didn't tell it "how to run in parallel" (imperative code).  Therefore, we did not have to:

  • explicitly start, stop threads (i.e., Thread.Start)
  • use BackgroundWorker
  • use callbacks (AsyncCallBack)
  • use BeginExecute asynchronous pattern

We simply told the code we want the tasks distributed among multiple cores and let the F# compiler figure out the hard part and generate the IL.  This is really powerful and in the very near future of "declarative parallel processing".  This is an example of what I mentioned earlier that the F# compiler has been designed recently and can include this type of "magic" right in the language.  C# does not have this feature and needs to be extended to provide this kind of automation.


Can't I do this with PLINQ?

Those familiar with the Parallel Extensions Libraries that will be added to .NET 4.0 might be aware that LINQ has been extended with parallelism features.  This allows you to extend your existing LINQ queries with parallism features.  This is known as PLINQ (parallel LINQ).  For example, a screen shot below shows a LINQ query that can be easily parallized by simply adding the AsParallel() extension method.

Unfortunately, the Parallel Extensions Library will NOT be available for Silverlight for the Visual Studio 2010 release.  However, I think that there is a good chance future versions of Silverlight will eventually get this feature.  There are some big features in the Silverlight assemblies that are simply missing and need to be added before features like PLINQ can be added.  This is exactly where asynchronous workflows can be substituted for PLINQ in a Silverlight application.  If you are working with large data sets, complex math computations, AI for a game, etc., parallelizing your code in F# libraries makes pefect sense for a Silverlight application.  This is MUCH easier than writing your own imperative multithreaded code.

How about the Performance?

I extended the functions and created functions for two, four and eight tasks and put this in a Silverlight application.  On my workstation (four cores), there was about a 50% improvement by parallelizing the two tasks.  With four tasks, the improvement in performance was about 3.5x.  As you can see, asynchronous workflows can easily dramatically improve the performance of your code on the Silverlight client.

Click the picture below to launch the demo application

 

Getting started with F#

Information on F# has been around for several years.  There are many articles, white papers, and books on F#.  However, you do have to be careful and get content that is recent and relative to the current F# release.  The F# specification has changed dramatically over the last several months as the language was being "productized" and many methods/functions simply don't exist in F# anymore.   Below are some links I put together where to get started.

Videos

  • Getting Started with F# - This video (from the 2008 PDC) is the place to start if you have zero F# experience and/or if you want a really good introduction into functional programming and some F# examples.

Books (I have read four different F# books and the two below are by far the best ones and most current.  Don Syme's F# book is good but a little outdated.)

Websites

  • http://www.fsharp.net/- This the main Microsoft F# page.  Includes numerours links, downloads for Visual Studio, F# extensions, etc.
  • Don Syme's blog - Don Syme is one of the main "creators" of F#.  His blog is a must read to get insight into advanced topics and upcoming F# news.

 

I hope this post gets Silverlight architects/developers exited about upcoming F# support.  F# is another tool that software architects can use that helps them create better software.  Furthermore, F# suport is another example of Microsoft's ability to integrate the Silverlight runtime across the .NET development stack.

kick it on DotNetKicks.com
Posted: Nov 04 2009, 16:16 by Bart Czernicki | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Announcing Next Generation Business Intelligence Software with Silverlight

 

 

I have been excited about Silverlight since Silverlight 1.1 Alpha was announced in early 2007.  I have seen tremendous potential in the RIA technology from its inception.  Being through the .NET 1.0 release in 2002 and seeing how Microsoft can make a powerful framework that can integrate with across their products made me feel secure that Silverlight was going to get full integration support by Microsoft.  Fast forward to 2009 and we are in the third release of Silverlight.  Silverlight has evolved tremendously and has caught up feature-wise with Adobe's RIA products (Flash, Flex, AIR) and is ahead in some features.  If you have been following this blog or my identity online, you are aware I am very passionate about the technology well beyond a Flash alternative.  I think Silverlight often gets compared to other RIAs and does not properly distinguish its attributes that make it a great business RIA.  Features like enterpise service integration (WCF, .NET RIA Services), HD Smooth Streaming, SharePoint (web parts), Bing SDK/Map integration, cloud computing (Azure), mobile, parallel computing, etc., are not amplified enough. 

One of my complaints is that the message of what this technology can accomplish in a business environment is currently being under-represented by the online community and Microsoft.  It is easy to find an article on how to do a flip animation or bind to a datagrid.  However, I think Silverlight needs to be represented better as a busines tool and how the RIA architecture can be applied to solve real business problems.  Take a look at the list of books available for Silverlight (http://www.silverlightshow.net/Books.aspx).  Looking at the list, you will notice that a majority of the books are essentially intros to Silverlight features.  Some of the books have different names, but essentially you are not getting an application of the technology to solve business scenarios.  Don't get me wrong; some of the books I have read truly stand out (i.e., John Papa's Data Driven Services, SharePoint Dev using Silverlight, Jeff Paries's Foundation Silverlight Animation) and go well beyond listing object properties and show you how to apply advanced engineering concepts using Silverlight. However, I saw an opportunity to provide a resource that shows how Silverlight can be applied to solve business problems.

Over the last two years, I have had the opportunity to use Silverlight in the enterprise and saw its potential for delivering Business Intelligence (BI) solutions.  Silverlight's ability to execute on the client and deliver visual intelligence makes it a fanastic option to surface interactive Business Intelligence analytical modules.  I decided to combine my experience of designing Business Intelligence solutions and apply these principles to Silverlight in a new book.  After about six months of work, I am pleased to announce my book Next Generation Business Intelligence Software with Silverlight 3.  The book will be available in the October/November timeframe and is currently listed as a pre-order on Amazon, Barnes and Noble, etc.

 

What will you learn from investing in this resource? 

Covering the entire scope of BI and applying these concepts to Silverlight applications is simply not realistic in one single resource.  Even if I had the option of writing 750 pages or more, important facets of BI would be missed.  Therefore, I decided to focus on the presentation tier of Business Intelligence applications.   For example, I didn't think it was fair to focus on the data and services tier with these technologies going through a rapid implementation and tooling evolution (RIA Services, WCF REST, Oslo, ADO.NET Data Services 1.5, etc.).  However, Silverlight's rendering and client processing engine is mature enough to warrant a guide on how to implement client-side BI concepts.  Therefore, topics like visual intelligence, data visualizations, predictive analytics, collective intelligence, interactive tools, parallel computing, working with large data sets, etc., are covered in my book on the presentation tier.

 

Who is this book for? 

This book has three intended audience segments and their goals:

  • Silverlight Developers - Learn how to extend your Silverlight knowledge in real-world applications.  Learn the basics of Business Intelligence 2.0.
  • Business Intelligence Professionals - Get a better understanding of how Silverlight can help you overcome some of the challenges to implement simple BI tools.
  • Strategic Decision Makers (architects, CIO, technical director, etc.) - Understand if Silverlight is the right platform to deliver BI software.

 

What is the chapter list?

  1. The first chapter (Business Intelligence 2.0 Defined) is an introductory chapter to Business Intelligence. This chapter will introduce BI and the new wave of BI 2.0. The content will show how Business Intelligence is evolving and embracing new software development advancements. This chapter will contrast classic BI and BI 2.0 by showing numerous examples of current software offerings. Lastly, this section will define the core items of BI 2.0 which will be implemented throughout this book using Silverlight.
  2. The second introductory chapter (Advantages of Applying BI 2.0 Using Microsoft Silverlight) introduces the Microsoft RIA technology: Silverlight. This chapter is dedicated to analyzing the current Microsoft Business Intelligence product vertical and providing opinions why Silverlight is a good fit for implementing Business Intelligence tenets.  After reading this chapter, you will understand the key enterprise and business integration features of Silverlight that will be discussed in this resource.
  3. Chapter Three (Silverlight as a BI Client) looks at what makes an effective BI client. It goes on to specifically detail Silverlight tools and features that can be used to create a fantastic functioning analytical experience. The chapter goes into specific functionality such as LINQ data queries, business algorithm implementations and local storage.
  4. In Chapter Four (Adding Interactivity to BI Data), the information from the previous chapters is used to show how to use Silverlight to bring interactivity to BI applications. This chapter will teach by example on how to add simple interactions that can make a BI client easier to use and feel more fluid. It concludes with how these concepts can be leveraged for future designs with multi-touch screens to create the ultimate interactive experience.
  5. Chapter Five (Introduction to Data Visualizations) is the first chapter in a series of chapters about Visual Intelligence. The content in this chapter will show the empirical advantages of creating a visual representation of data versus classic tabular layouts. This chapter shows how visualizing data has matured and grown over the last several years. The concept of natural visualizations is introduced by defining the different characteristics and Silverlight implementations.
  6. Chapter Six (Creating Data Visualizations for Analysis) continues to build on the visual intelligence topic by showing how to enhance data visualizations with features to make turn them into analytical tools. This chapter will show you how to create advanced visualizations by extending the default Silverlight data visualization presentation.
  7. Chapter Seven (Enhancing Visual Intelligence in Silverlight) is the last chapter that focuses on creating complex composite data visualizations.  You will also see how Silverlight as a professional visual intelligence environment can implement BI 2.0 functionality.
  8. Chapter Eight (Applying Collective Intelligence) introduces collective intelligence as a form of social Business Intelligence. This chapter defines the importance of Collective Intelligence on the web today.  Furthermore, you will see how Silverlight can be used to gather and surface Collective Intelligence to users.
  9. Chapter Nine (Predictive Analytics) will describe how to integrate forward-looking data structures in our client logic to perform "what-if" scenarios. This chapter will also show how statistics used on aggregates can deliver instant insight on future events.
  10. Chapter Ten (Improving Performance with Concurrent Programming) is an advanced chapter that covers additional enhancements that can be gained by using multiple cores to aid in BI calculations. You will see how you can enhance the performance of BI modules by leveraging Silverlight’s advanced CPU and GPU programming features.
  11. Chapter Eleven (Integrating with Business Intelligence Systems) is a chapter that shows you how to apply the concepts that you have learned and integrate them into new solutions or existing BI systems.  Silverlight in an SaaS delivery model as well as Silverlight web parts are covered in this chapter.
  12. Appendix A (Prototyping Applications with Dynamic Data) includes a short primer on prototyping data applications in Microsoft Expression Blend 3.  This short section provides a quick overview on how to use Blend’s dynamic data feature to quickly create and add data to UI functionality without having to spend time architecting databases and services.  This is a powerful tool to prototype BI 2.0 analytical modules without needing access to large-scale data repositories.

 

Companion Web Site

In addition to providing the source code and samples with this book, I have decided to create a companion web site for this resource.  I don't think it would be fair for me to claim that this book can be fully understood by non-Silverlight developers if all that was provided was a zip file with source code.  The companion web site will include all of coding scenarios as live demos which will allow readers without the full Silverlight development environment to fully understand the content.  Furthermore, it will include the source code and samples that were not covered in detail in the book.  I plan to use the companion web site as a vehicle to deliver further information on Business Intelligence and Silverlight in the form of web resource links, training videos, whitepapers and more advanced examples.  I am currently working on the companion web site and it will be launched when the book is closer to being published.

 

If you are a Silverlight developer or interested in Business Intelligence, I encourage you to give my book a try to see how visual and interactive analytical tools can be delivered to average users with Silverlight.

Sample Content of What You Will See In This Book

Creating a Silverlight Predictive Analytics Tool to estimate future sales revenue

 

Optimizing Data Processing with Concurrent Programming (looks scary; it really isn't)

 

Learn about distributive client-side architecture for BI

 

 

Silverlight as an enterprise Visual Intelligence Environment (Trellis Data Visualization with KPI goals)

 

 

Don't worry if this is all alien to you...I will walk you through BI 2.0 fundementals as well...

 

kick it on DotNetKicks.com

Posted: Sep 20 2009, 13:44 by Bart Czernicki | Comments (10) RSS comment feed |
  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: BI | Book | Enterprise | Silverlight 3
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us