Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Friday, March 05, 2010

Persisting the Configuration

by jesseliberty via Jesse Liberty - Silverlight Geek on 3/5/2010 3:11:37 AM

MiniTutorialLogo

 

SLHvpLogo For this week’s release of the Silverlight HyperVideo Platform we are committed to having configuration information retrieved from a database. To accomplish this we need (want?)

Smooth-streaming videos that we can use to illustrate the relationship among Items, Topics and Links and

A Database in which to store the configuration information

Step 1 was accomplished by

  • Creating the videos
  • Creating image files
  • Uploading the videos and images to MSN where the videos were encoded for smooth streaming and URLs were returned for the image and for the video
  • Watching the videos and noting where we want to mark topics and links
  • Adding that information to the database

Step 2 was accomplished by creating a Database with four tables

  • Listables
  • Items
  • Topics
  • Links
The Listables table’s relationship with the other three is isomorphic to the relationship between the Listable base class and the derived classes Item, Topic and Link.  All of this is captured in the database diagram:

 

[Click on image for full size]

HVP-Config-DB

Foreign Keys

The Sets, Items, Topics and Links tables each represent part of an object, with the remaining part held in Listables.  This “normalization” of the database reduces the duplication of data, and thus reduces the likelihood of database corruption. 

The Sets, Items, Links and Topics tables each have a column titled MyLinkableId which is a foreign key linked to the key ID field in the Linkables table. This lets us create views such as this definition of the ItemsView

SELECT      dbo.Items.ID AS ItemsID, 
            dbo.Items.ItemUri, 
            dbo.Listables.ID AS ListablesID, 
            dbo.Listables.TextToDisplay, 
            dbo.Listables.ImageSource, 
            dbo.Items.MyListableID
FROM        dbo.Items INNER JOIN
            dbo.Listables ON 
               dbo.Items.MyListableID = dbo.Listables.ID

 

ItemsView

 

As shown in the image, the column MyListableID in Items and the column ID in Listables are used to join the two tables together into a complete Item.

An Item’s Links and Topics

The second set of connections from each of Links and Topics to the Listables (colored blue) represent the has a relationship from Items to Topics and from Items to Links.

Thus, the database has captured all the object relationships, but has translated it into relational terms.

The next step is to use the Entity Frameworks to translate back to objects, and WCF RIA Services to create those objects both on the database server and on the Silverlight client.

From Code To Clouds

When we roll out the player tomorrow, the videos will be on the MSN server, the Configuration Database will be hosted on a MaximumASP server, and the HVP will be served on Silverlight.net (!)

This work is licensed under a Creative Commons license.
email it!bookmark it!digg it!

Original Post: Persisting the Configuration

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us