Oct 25, 2007

Introducing Basic Back-End Services: From AJAX to Silverlight

My previous post describes the overall problem of communicating with services from Silverlight. Let's now concentrate on one specific but very important part of it: "basic back-end services" (and by the way, if you can think of a better name for this please let me know :)

What I mean by "basic back-end services" is services that you write specifically for your Silverlight app.

Let's take an example: Suppose you want to create an interactive shopping application (something like this or even this). Your users will search for products, add them to a shopping cart, enter payment information, and so on. Clearly some information needs to flow between the browser and the back-end server for this to work.

Traditionally (in the pre-AJAX world) if you wanted to do this on the Microsoft platform, you would create a bunch of .aspx pages in ASP.NET that would communicate with the server using postbacks. When a user entered a search string and hit "Search", it would generate a POST to the server, which would then respond with a newly-generated page.

AJAX eliminated the need for page refreshes, and introduced the notion of "back-end services". These services process very specific information and return very specific replies instead of resending the entire page after every request. In this model, when the user hits "Search", a request is sent to the back-end service which replies with just the search results (instead of an entire HTML page that happens to contain the results). It is the job of JavaScript code to then integrate these results with the rest of the page.

Again, if we look at the Microsoft platform, ASP.NET AJAX makes this very easy with the UpdatePanel control: you don't need to write any code and you don't have to even know that these back-end services are there - you can think of them as being created automatically for you.

There are limits to what the UpdatePanel can do, and so to get more flexibility you will need to write custom services (and the JavaScript code that uses them) yourself. With ASP.NET AJAX, there are different options to write them (page methods, .asmx services, WCF services), but it all essentially boils down to the same thing: you are using JavaScript to remotely call a method. The "Search" button on your shopping site will essentially call something like GetProductList("searchString") on your back-end server, "Add To Cart"will call something like AddToCart(productId), and so on.

Notice that these back-end methods are very specific to your particular application - they are normally written specifically for this purpose and not reused for anything else. This is exactly the basic back-end services that this post is about. The opposite of this case is the interoperability problem - talking to services that have already been established for purposes other than your specific application and that you cannot change - but I will cover that separately.

So how do basic back-end services work in Silverlight? Well, in 1.0 you cannot call them from within the Silverlight app itself - your only option is to use JavaScript on the page that hosts your Silverlight control and use all of the AJAX techniques I described above.

In 1.1, you will be able to call services directly from .NET code in your Silverlight application. I will explain how in the next post.

61 comments:

wow gold said...

Weekends to peopleig2tmean that they can have a two-day wowgold4europe good rest. For example, people gameusdcan go out to enjoy themselves or get meinwowgoldtogether with relatives and friends to talk with each storeingameother or watch interesting video tapes with the speebiewhole family.
Everyone spends agamegoldweekends in his ownmmoflyway. Within two days,some people can relax themselves by listening to music, reading novels,or watchingogeworld films. Others perhaps are more active by playing basketball,wimming ormmorpgvipdancing. Different people have different gamesavorrelaxations.
I often spend weekends withoggsalemy family or my friends. Sometimes my parents take me on a visit to their old friends. Sometimesgamersell I go to the library to study or borrow some books tommovirtexgain much knowledge. I also go to see various exhibition to broadenrpg tradermy vision. An excursion to seashore or mountain resorts is my favorite way of spending weekends. Weekends are always enjoyable for me.
igxe swagvaultoforu wowgold-usaignmax wowgoldlivebrogame thsaleGoldRockU

Anonymous said...

網頁設計,網頁設計公司,最新消息,訪客留言,網站導覽
情趣用品,情趣用品,情趣用品
色情遊戲,寄情築園小遊戲,情色文學,一葉情貼圖片區,情人視訊網,辣妹視訊,情色交友,成人論壇,情色論壇,愛情公寓,情色,舊情人,情色貼圖,色情聊天室,色情小說,做愛,做愛影片,性愛

免費視訊聊天室,aio交友愛情館,愛情公寓,一葉情貼圖片區,情色貼圖,情色文學,色情聊天室,情色小說,情色電影,情色論壇,成人論壇,辣妹視訊,視訊聊天室,情色視訊,免費視訊,免費視訊聊天,視訊交友網,視訊聊天室,視訊美女,視訊交友,視訊交友90739,UT聊天室,聊天室,豆豆聊天室,尋夢園聊天室,聊天室尋夢園,080聊天室,080苗栗人聊天室,女同志聊天室,上班族聊天室,小高聊天室
AV,AV女優
視訊,影音視訊聊天室,視訊交友
視訊,影音視訊聊天室,視訊聊天室,視訊交友,視訊聊天,視訊美女,視訊辣妹,免費視訊聊天室
自慰器,自慰器

Railroads said...

You do have a point here :) I admire the stuff you post and the quality information you offer in your blog! Keep up the good work dude. Please come visit my site Transportation companies when you got time.

Security guards said...

Me and my friend were arguing about an issue similar to this! Now I know that I was right. lol! Thanks for the information you post. Please come visit my site Security systems when you got time.

eda said...

101煙火,煙火批發,煙火工廠,製造浪漫煙火小舖,煙火小舖,衣蝶,衣蝶,情趣用品,情趣商品,情趣,情趣,衣蝶情趣精品百貨,衣蝶情趣精品百貨,煙火批發,情趣禮品,成人用品,T字褲,按摩棒,情趣內衣,情趣精品,情趣商品,情趣用品,情趣,情趣,真愛密碼情趣用品,真愛密碼,真愛密碼,真愛密碼情趣用品,貓裝,自慰器,性感內褲,角色扮演,丁字褲,,跳蛋,AV,丁字褲,煙火,情趣用品,情趣用品

Warren Michigan yellow pages said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Warren Michigan yellow pages when you got time.

Orange California Business Directory said...

I found your blog on google and read a few Thanks for the information you mentioned here, I'm looking forward to see your future posts. Cheers !! Please come visit my site Orange California Business Directory when you got time.

poll said...

love your blog! Very cool! Please come visit my site Fresno Business Directory when you got time.

poll said...

You owe a very nice and interesting blog. Please come visit my site Sacramento Business Directory when you got time.

Steel Roofing said...

I really liked your blog! You have some great content. Please come visit my site Roofing when you got time.

Signs said...

Thanks for posting, definitely going to subscribe! See you on my reader. Please come my site Signage when you got time.

poll said...

Really it is nice post and thanks for sharing it and really it is very useful. Please come visit my site Cleveland Yellow Page Business Directory when you got time.

poll said...

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business Thanks for all your help and wishing you all the success in your business Please come visit my site Cincinnati Yellow Page Business Directory when you got time.

amateur porn said...

It is very interesting article and quite impressive and more informative and looking forward to read such article. Please come visit my site deleted youtube videos when you got time.

doll said...

I always look forward to your new posts, I learn more compared to school. Always looking forward. Thank you. Please come visit my site Alberta facts when you got time.

touchscreen point of sale software said...

You share valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up. Please come visit my site point of sale cash register
give me any valuable feedbacks.

time management plan said...

I was thinking of looking up some of them newspaper websites, but am glad I came here instead. Although glad is not quite the right word… let me just say I needed this after the incessant chatter in the media, and am grateful to you for articulating something many of us are feeling - even from distant shores. Please come visit my site time management techniques give me any valuable feedbacks.

lla said...

cell phones
cheap cell phones
wholesale cell phones
discount cell phones
cell phone china
cell phones wholesale
Mobil phones

trucking companies said...

You owe a very nice and interesting blog. Feel free to check out my site trucks when you got time.

trucks said...

Such interesting read and information, thanks for sharing this post. I will check back to read your other new posts. Please come visit my site storage when you got time.

social anxiety disorder treatment said...

As a Newbie, I am always searching online for information that can help me. Thank you. Please come visit my site social anxiety disorder when you got time.

generalized anxiety disorder said...

As a Newbie, I am always searching online for information that can help me. Thank you. Please come visit my site generalized anxiety when you got time.

rr8004 said...

I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future. Please come visit my site Local Business Directory Of Wichita U.S.A. when you got time.

rr8004 said...

Really great work. Congrats to everyone who are involved with this project. The website layout and graphics are really cool. Please come visit my site Local Business Directory Of Newark U.S.A. when you got time.

poll said...

Thanks for posting, definitely going to subscribe! See you on my reader. Please come visit my site Montgomery Business Directory when you got time.

poll said...

Hello, What enticed you to post this article. It was extremely interesting, especially since I was searching for info on this subject last Thursday. Please come visit my site Henderson Yellow Page Business Directory when you got time.

math tutoring said...

You share valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up. Please come visit my site high school give me any valuable feedbacks.

accountants said...

I was thinking of looking up some of them newspaper websites, but am glad I came here instead. Although glad is not quite the right word… let me just say I needed this after the incessant chatter in the media, and am grateful to you for articulating something many of us are feeling - even from distant shores. Please come visit my site irs give me any valuable feedbacks.

poll said...

that your great job is clearly identifed. I was wondering if you offer any subscription to your RSS feeds as I would be very interested and can’t find any link to subscribe here. Please come visit my site Phone Directory Of Indiana when you got time.

poll said...

that your great job is clearly identifed. I was wondering if you offer any subscription to your RSS feeds as I would be very interested and can’t find any link to subscribe here. Please come visit my site Iowa Yellow Page Business Directory when you got time.

funny video's said...

I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here. Will be back often to read more updates! Please come visit my site funny video's when you got time.

Wholesale Distributor said...

Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog? Please come visit my site jewelry give me any valuable feedbacks.

wholesale gift said...

I usually don’t leave comments!!! Trust me! But I liked your blog…especially this post! Would you mind terribly if I put up a backlink from my site to your site? Please come visit my site home accent give me any valuable feedbacks.

rr8004 said...

This is just another reason why I like your website. I like your style of writing you tell your stories without out sending us to 5 other sites to complete the story. Please come visit my site Services Business Directory Memphis when you got time.

rr8004 said...

This is just another reason why I like your website. I like your style of writing you tell your stories without out sending us to 5 other sites to complete the story. Please come visit my site Memphis Directory Businesses when you got time.

rr8004 said...

What a facinating article. I’m looking for a marketing expert to help with a project, could you help? Please come visit my site San Diego Phone Numbers when you got time.

rr8004 said...

What a facinating article. I’m looking for a marketing expert to help with a project, could you help? Please come visit my site San Diego Business Search when you got time.

Divorce Advice said...

You owe a very nice and interesting blog. Feel free to check out my site Divorce Advice when you got time.

Document Shredding said...

Such interesting read and information, thanks for sharing this post. I will check back to read your other new posts. Please come visit my site Document Shredding when you got time.

Antique Guide said...

Thank you for your good humor and for allowing yourself to be convinced that this was the right show for you to work on. Please come visit my site Antique guide when you got time.

Wills, Trusts & Estate Planning said...

Oh Pat, you’ve got friends! Don’t give me that. Your blog looks great and has good info. You can be friends with me. Please come visit my site Wills when you got time. Thanks.

lilena said...

Beauty Schools And Cosmetology Schools, Beauty Careers and Cosmetology training online guide. Find out how to find the best cosmetologist schools, career and job descriptions of spa therapist, hair designer, makeup artist.cosmetology career information

lilena said...

Growing Corn, corn plant, corn planting, sweet corn planting basics. corn plant

rr8004 said...

I really liked your post on home financing! if you have more information elsewhere let me know. Please come visit my site Business Resources Comprehensive Listings when you got time.

rr8004 said...

I really liked your post on home financing! if you have more information elsewhere let me know. Please come visit my site Arlington Business Phone Numbers when you got time.

rr8004 said...

It is very interesting article and quite impressive and more informative and looking forward to read such article. Please come visit my site City Guide Corpus Christi when you got time.

rr8004 said...

It is very interesting article and quite impressive and more informative and looking forward to read such article. Please come visit my site Corpus Christi City Business Listings when you got time.

thomson said...

Online resources of toe fungus, fungus treatment, nail fungus toe. fungus treatment

thomson said...

Potty training tips, baby potty training. Resource guide on how to potty train, potty training for boys and girls.baby potty training

lilena said...

Tooth Decay, tooth decay Symptoms, tooth decay Causes, Treatments, Prevention Tooth Decay

lilena said...

Beauty Schools And Cosmetology Schools, Beauty Careers and Cosmetology training online guide. Find out how to find the best cosmetologist schools, career and job descriptions of spa therapist, hair designer, makeup artist.beauty career

thomson said...

Herniated disc symptoms, Herniated Disc Pain, treatment and developmental online guide. herniated disc treatment

thomson said...

Symptoms bronchitis, bronchitis chronic, bronchitis treatment.bronchitis natural

rr8004 said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Louisville Business Directory when you got time.

rr8004 said...

Awesome! I have read a lot on this topic, but you definitely give it a good vibe. This is a great post. Will be back to read more! Please come visit my site Louisville Yellow Page Business Directory when you got time.

rr8004 said...

Excellent article , i just share it with my friend of Italy. I Stumble UP your blog post , you will notice an increase of traffic within 24 hours for targeted people. Cheers . Please come visit my site Fresno Yellow Pages when you got time.

rr8004 said...

Excellent article , i just share it with my friend of Italy. I Stumble UP your blog post , you will notice an increase of traffic within 24 hours for targeted people. Cheers . Please come visit my site American Fresno online business directory when you got time.

rr8004 said...

Couldn't be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing! Please come visit my site Business Yellow Pages Scottsdale when you got time.

rr8004 said...

Couldn't be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing! Please come visit my site Free Business Listing of Scottsdale when you got time.

rr8004 said...

Wow, loving the two photos you posted. You got potential. Please come visit my site Raleigh City Business Listings when you got time.

rr8004 said...

Wow, loving the two photos you posted. You got potential. Please come visit my site Directory Raleigh City when you got time.