This is a mirror of official site: http://jasper-net.blogspot.com/

Build a Pandora clone with Silverlight 4

| Wednesday, November 24, 2010
For the uninitiated, Pandora is a popular Flash-based internet radio service: users create their own radio stations by seeding an artist or song, and by giving a thumb-up or thumb-down to played songs. The software responds by playing more of what the user likes based off these inputs.

In this article, I'm going to show you how to build a Pandora-like music service using Silverlight 4, WCF, and Entity Framework. The end result is Chavah ("HA-vah"), a fun Silverlight clone of Pandora which can be seen live at judahhimango.com/chavah.

Introduction

Why build a Pandora clone, you ask?

I have a selfish motivation: Pandora doesn’t play the music I’m most interested in. As a Jewish follower of Yeshua (Jesus), I enjoy a tiny genre of religious music called Messianic Jewish music, a genre so small Pandora doesn’t know about any of our music.

I thought, “Why not build a Pandora clone to play some great Messianic Jewish tunes?” It would serve myself primarily, but also others in our community. And it'd raise the awareness of some of the great Messianic music out there to boot.

But a more general motivation is, “Why not?” If anything, it’s a great learning experience to expose one’s self to a full client/server application using Silverlight, WCF, and Entity Framework. These technologies are currently popular and in demand by employers, so it’s great résumé fodder to boot.

Out of these motivations, the Chavah project was born. Chavah is my attempt to build a Pandora-like clone that plays Messianic Jewish music, and is the subject of this article.

Why Silverlight?

During the 2010 Professional Developer’s Conference, Microsoft hyped up IE9 and its HTML 5 support, without commenting much on Silverlight. Because of this, there has been speculation as to whether Silverlight would fade out in favor of HTML 5; folks questioning why to use Silverlight over HTML 5.

While Microsoft has since reiterated their long term support for Silverlight, the question of why use Silverlight was a very real question when starting a web app like Chavah.

My reasons for ultimately choosing Silverlight are pragmatic:

  • Silverlight is more cross-platform than HTML 5. Most of my target audience is still running browsers with limited or no HTML 5 support. And even for the few that do have HTML 5-compatible browsers , the support is neither consistent across browsers, nor stable. My target audience is Windows and Mac, and Silverlight runs great on both, right now, in most any web browser.
  • The tooling kicks ass. Visual Studio + Blend is a hard combo to beat. C# is a great language with great tool and refactoring support. Animations, paths, soft UI edges, glow effects, drop shadows, and all things UI sexy are easy with Blend. 
  • Silverlight will always be a step ahead of the HTML spec. By the time HTML 5 has broad reach, Silverlight will have features that only HTML 6 will bring. This is the nature of design-by-committee of the HTML spec. Silverlight will innovate and bring new features plain old HTML is missing, and will deliver it faster and broader than the HTML spec ever will.
  • Silverlight is an app development platform; HTML was intended for documents. Chavah is an application, not a document. HTML + Javascript + CSS hacks can turn a document into an app, but ultimately, a platform built for apps is more compelling for an application like Chavah.
  • Since Chavah is an application, I want users to be able to install Chavah locally onto their desktops. With Silverlight’s out-of-browser capabilities, users can optionally install Chavah as a native application. This simply would not be possible with HTML + CSS + Javascript, barring browser-specific hacks like IE9’s “pinned sites” or Google Chrome’s “application shortcuts”.

Points of Interest

In showing how Chavah is built, this article will show you how you can simulate the look and feel of apps like Pandora – smooth UI layout, animations, fluid feel – all in Silverlight 4. I’ll show you how a real-world application can make use of some of the new features in Silverlight, like out-of-browser functionality, easing animations, and GPU acceleration.
Additionally, we’ll cover communication with the backend WCF web service where the “pick a song based off the user’s likes and dislikes” logic is located.

I’ll show you how to add some fun social features to your application using WCF, Entity Framework, and SQLite.

Read more: Codeproject

Posted via email from .NET Info

0 comments: