Page view counter

Silverlight and Data

 

 

Tim and I and many others have been discussing, off and on, the frequent requests for videos/tutorials/demos, etc. that show how to move data into and out of databases and display them in Silverlight.

On the one hand, my response is that the very question reveals that we've not done a good enough job explaining the boundaries of Silverlight as a UI tier-framework; that once you're talking about creating (rather than consuming) a web service and once you're writing LINQ you are outside of Silverlight.

On the other hand, I see two compelling counter arguments.

#1 is that by showing the complete set of tiers and how they interact (SQL and whatever technology we choose to get the data in and out (e.g., Linq or  Astoria) and WCF to create a web service, and Silverlight consuming the web service, probably creating business objects, and a DataGrid in Silverlight to display the data, along with two way binding, we better establish where the actual boundaries of Silverlight lay and how Silverlight interacts with these other technologies.

iStock_EngineXSmall

#2 is that for most of our readers Tim and I may be "Silverlight Developer Community Program Mangers" but really we're just Microsoft techies. And as I wrote in a private correspondence "when I go into my Subaru dealer, I understand that one guy may be a transmission specialist but that doesn’t mean he can’t answer a simple question about how frequently I should change my oil.  If I feel it is clear that the explanation I’m asking for will take sitting down and getting into details and really call upon his specialty that is one thing, but if it is just a general Subaru question, then his answering “oh, I don’t do oil”  would probably infuriate me and it certainly wouldn’t help me understand where the transmission system ends and the engine system begins and how they both form part of the powertrain."

So, after thinking about this quite a bit, I think we have to show the entire power train: from inside the SQL db through displaying it in a DataGrid, but with a clear emphasis on the Silverlight front-end and how and where you can learn more about the other enabling technologies for the other tiers.

More to come, but I invite your feedback.

-j

Published Sunday, October 19, 2008 1:02 PM by jesseliberty
Filed under: ,

Comments

# re: Silverlight and Data

jesse,

I think you got it right,  I do not need you to tell me how to build a database structure, but I am interested in how you would propose I integrate with it using silverlight.  Tims screen casts on webservice integration are very helpful but there is always some missing element, a special trick, config setting, dll to reference, to get a real world running version.  Seeing how both of you propose any UI-tier integration is useful

Sunday, October 19, 2008 2:13 PM by Steve Strong

# re: Silverlight and Data

Steve: thanks for the feedback.  Regarding the web service one, have you seen silverlight.net/.../learnvideo.aspx because one thing I do cover there is specifically all the required web.config and specific settings needed to consume a WCF service (ASMX requires none).  Luckily in Silverlight 2 tools now we have a Silverlight-enabled WCF template that does all this work for you!

Sunday, October 19, 2008 4:02 PM by heuertk

# re: Silverlight and Data

If you are going to do this, try to do a "real world" application. If people (us the consumers of your videoes :) ) see the techniecs used in a situations we can relate to some how, it's often easier to understand.

So do a chat application, make ScottGu's chat client finished with logging of the conversation in the database or so, so he can finally talk to the real BillG, and not just the bot :P And as Scott already started this application, why don't finish it up?

Sunday, October 19, 2008 4:33 PM by Qbus

# re: Silverlight and Data

Obus,

Hey I love that idea,  complete a simple backend to ScottGu's chat application.

As for the webservice one, that vidio was critical to get something running, so I thank you a lot for it.

Sunday, October 19, 2008 6:03 PM by Steve Strong

# re: Silverlight and Data

Hi,

I Consume WCF service for my forum and man I did read everything about WCF and how data was working with SilverLight because this was the most important aspect of using SilverLight to my opinion

If you would like to see what it looks like in action,  go to gearworld.dyndns.org/devpreview opened between 6:00AM and 9:00PM EST.  

In this forum, from the login to writting a message, everything is using WCF and LINQ to SQL which I would never change for anything else now that I know it works so well.

Thank you for these great technologies.

Sunday, October 19, 2008 6:48 PM by GearWorld

# re: Silverlight and Data

With the MVC beta out at the same time Silverlight 2 went RTM it would be nice to see some basics with the two together.

Sunday, October 19, 2008 7:47 PM by wisecarver

# re: Silverlight and Data

Maybe take a look at what Rob Conery is doing with asp.net mvc.  He is taking a full app from start to finish.  Personally I would like to see some type of LOB application done this way in Silverlight.  I think we all really hate data demos since the days of the VB 4 data control where someone as MS did a demo by dragging a DAO data control onto a form binding it and bang there it is.  We all, at the time went oh ah.  But now we say what about validation, concurrency, error handling, displaying and handling data differently to how it is stored in the database, security, globalization and in the case of silverlight with async data retrieval what about the eye candy that needs to display to the user for each request and handling errors when the request times out or the connection goes down.  I guess I would like to see you guys combine it all into one app therefore giving us some guidance on what you believe and possibly MS believe are good practise.

At the moment sure we can piece allot of what you guys have done together, but I think some examples are still the old vb 4 data control.  Maybe if you do a demo that takes data from an astoria service then you could do part 1, quick and dirty never run in production, part 2 with validation, concurrency, error handling and eye candy waits as well.  While these might not be silverlight specific things I think because of the Async nature of silverlight we arent seeing these demos elsewhere.  

Sunday, October 19, 2008 7:57 PM by sariel

# re: Silverlight and Data

I agree with your assessment that it's hard to prescribe a way to build Silverlight applications that use data without blurring the boundaries between Silverlight and the supporting technologies behind it. For what it's worth I have a 7-part blog series that covers each tier from LINQ to SQL for the data layer, WCF for the service layer, and Silverlight consuming the data, making changes, and updating.

You can find that here: www.dimebrain.com/.../linq-wcf-silver.html.

I didn't cover data-binding on the client itself, but that should be the final piece in this puzzle. Paul Stovell's Bindable LINQ opens up some interesting possibilities in this area.

Sunday, October 19, 2008 8:48 PM by Dimebrain

# re: Silverlight and Data

I would like to see the following in a SL2 data application.

1. Daisy-chaining the async data queries from a database using WCF service.  Let's say you can only call and retrieve 25 records due to process speed and size of data recovered.  You have a total of a 100 records so you would need to call async Method 4 times.  How do you retrieve all records and combine them?

2. Self-Hosted Services.  Include and describe the service you need to create to get the crosspolicyaccess.xml file.

Sunday, October 19, 2008 10:14 PM by shaggygi

# re: Silverlight and Data

I agree with your decision, I'm always looking for silverlight Line-Of-Business Applications. I found a good sample: www.silverlightshow.net/.../Building-a-Framework-for-Silverlight-Line-Of-Business-Applications.aspx

This article provides an example of a LOB application based upon the AdventureWorks company often used in Microsoft sample applications, and uses the Microsoft SQL Server demonstration database as provided by Microsoft.

The problem with this sample, it doesn't have enough details to understand it.

I would like to see you combine it all into one application giving us some guidance on what MS believe are good practice.

Thanks

Sunday, October 19, 2008 10:20 PM by rachidadukes@live.com

# Silverlight news for October 20, 2008

Pingback from  Silverlight news for October 20, 2008

Monday, October 20, 2008 8:18 AM by Silverlight news for October 20, 2008

# Dew Drop – October 20, 2008 | Alvin Ashcraft's Morning Dew

Pingback from  Dew Drop – October 20, 2008 | Alvin Ashcraft's Morning Dew

# re: Silverlight and Data

I definitely would like an end-to-end example for a LOB application. Something like Northwind application or similar would be great.

As a starter it would be good to just show how to be use either WCF or ADO.NET Data Services for this.

Longer term it would be great to have a full-blown application using Prism, Silverlight, ADO.Data Services/WCF with best practices (separation of concerns, security, unit-testing, etc.) showing a LOB application.

Monday, October 20, 2008 9:12 AM by rhaug

# re: Silverlight and Data

The end-to-end sample is the only way to go.

Hundreds of us are scouring the Internet for a realistic (but manageable and not over-engineered) sample of manipulating data (CRUD operations) in a Silverlight 2 application. There are promising pieces of the puzzle scattered all over the place. Unfortunately, after investing time in a sample, we discover it lacks a key element - like actually saving changed data back to the database.

Aggravating the problem is the fact that many of us are venturing into WCF for the first time while we ramp up with Silverlight projects. That means we confront a lack of knowledge about Silverlight databinding AND the peculiarities of binding to WCF services that we don't fully master.

Ken

Monday, October 20, 2008 12:09 PM by Ken Cox [MVP]

# Post: 198

Post: Approved at: Oct-20-2008 SL Controls with Effects and Transitions "I'm working on one

Monday, October 20, 2008 12:37 PM by Mirrored Blogs

# re: Silverlight and Data

>>Aggravating the problem is the fact that many of us are venturing into WCF for the first time while we ramp up with Silverlight projects. That means we confront a lack of knowledge about Silverlight databinding AND the peculiarities of binding to WCF services that we don't fully master.<<

Ken, well said! I'm hoping as time goes on, MSFT will provide a more official "Pattern & Practices" for developing LOB application. As another poster pointed out, there is so much involved that just reading and writing data isn't everything. Plus, having too many new technologies trying to make them work together without any guidelines (WCF, LINQ, Astoria, EF,SL, Async and etc.)is just too overwhelming. So, I'm not sure what Jesse can do to address most of these issues. I think this subject is much deeper and more vast to tackle via a blog post. Again, I hope to see more official solutions from MSFT to address the overall LOB ecosystem!

..Ben

Monday, October 20, 2008 3:24 PM by BenHayat

# re: Silverlight and Data

I agree with Ken Cox.

I have studied the tutorials/videos on www.silverlight.net and I understand the big picture as regards LINQ to SQL, WCF and Silverlight but I would love to see a practical CRUD tutorial.

Lets see something that uses LINQ/WCF or Astoria. That way we can compare both approaches.    

Monday, October 20, 2008 4:06 PM by anmotayo

# re: Silverlight and Data

I find this discussion interesting.

When I look at a new technology, I really only want to focus on what is new or different in what I need to do to support that specific technology. I have never used a reference app as a guide: they get too muddy, tend to show someone else's idea of a "good" architecture, and generally are too big to absorb reasonably.

For me, the worst demos are the ones that spend too much time talking about something outside the specific technology we're trying to learn.

I might not be the audience for this, but felt I had to chime in :)

Pete

Monday, October 20, 2008 10:29 PM by Psychlist1972

# 2008 October 21 - Links for today &laquo; My (almost) Daily Links

Pingback from  2008 October 21 - Links for today &laquo; My (almost) Daily Links

# re: Silverlight and Data

This is great news! I too would like to see a LOB application and I agree with shaggygi: an approach to how to deal with firing of multiple async queries would be much appreciated.

I would also like to see the best way to implement business logic when your EF is exposed through a Data Service.

Tuesday, October 21, 2008 10:24 AM by jasonbsteele

# re: Silverlight and Data

You'll be marching through the streets with Tim on your shoulders and I'll be a footnote :-)

That said, I will try to fill in the corners will videos, tutorials and blog entries, but he is the guy who has been charged with building the LOB end-to-end demo and I know he'll do a great job (I'm deeply jealous).  

Keep an eye out for his "corner"

Wednesday, October 22, 2008 2:25 PM by jesseliberty