作者:empty 页数:358 出版社:empty |
About the AuthorMany people say that by looking at a persons dog.you can tel what theperson is like.Well, the picture of me is my dog Lou ys, an English BulldogAnd yes, my English Bulldog and I have many common characteristics.I has spent oodles of time strapped to a chair debugging and taking apartI NICK MCCOLLUM has more than 18 years of experience designing anddeveloping enterprise applications on a variety of platforms.He isa principal consultant for Nu Soft Solutions, Inc, and is currently thearchitectandleaddeveloperforhttp://Mw.spout.com, Nick has actedasatechnicaleditorforthefollowingpublications:CWCOM+Pragranamingby Derek Beyer(John Wiley&Sons, 2001] and Pro Ajax and the.NET 2.0Platform by Daniel Woolston(A press, 2006) .He is a Microsoft CertifedJSo luton Developer and frequently speaks at Microsoft events and localBut what about my biography?Its pretty simple; Iama guy whocode.In fact, I really enjoy this business we call software development.T have ever sinceI learned howto peek and poke my first by tesT have written various books, including AjaxPatterns and BestPractices and Howto Code.NET, all available from A press.About the Technical Reviewersusergroup meetings in the West Michigan area.BERNHARDSEEFELDcofoundedtheSwisssearchenginehttp://search.chin1995, whereinOctober 2004, he released the first worldwide Ajax mapping application,http://map.search.chBernhard holds an MSc in theoretical physics from the University of Berne, Switzerland.These days T enjoy coding and experimenting with NET, as it is a fascinating environment..NET makes me feel like a kid opening a present on Christmas morning You had an idea whatthe git was, but you were not completely sure.And with NET there is no relative giving you socksor a sweater.Its excitement all the way l
Introductionl wrote this, and I have a good fe ling about it It anodd way to begin a book, but Ilk e thisbook because of what it represents, the building of Asynchronous JavaScript and XML[Ajax)applications using Webservices.I have been developing Webservice-based applications since1999.With Ajax, Webservices has found its killer combination.sent ational State Transfer{REST) -based Webservices and functionality:I want to promote thedevelopment of applications that are decoupled(client code is separate from the server code J,applications that can be adequately tested and main tal ned, and code that can be used by clientsoutside of the Ajax context.I believe in Ajax, but I also believe that if you can develop Ajax codethat non-Ajax clients can access, then your application has a distinct advantage over others.This book focuses on practical solutions for implementing Ajax, JavaScript, and Repre-This book features the following chapters:·Chapterl-GettingStarted:Thefocusofthischapterisonunderstandingthedefini-tions of Ajax, REST, Webservices, and service-oriented architecture(SO A) .Ive basedthe definitions on opinions in the industry, and understanding the definitions makes.itsimpler for you to understand the context of Ajax/REST and the rest of this book.Thisfirst chapter also cover show to test your Ajax/REST application using JavaScript.Itshows you howto test Webservice contracts and JavaScript client code·Chapter2-JavaScriptRecipes:Thefocusofthischapterisonexplaininghowtowritemore advanced JavaScript functionality.This chapter covers the following techniques(among others J:using delegates that allow multiple methods or functions to be called,using functions as objects with state, and using functions to initialize and make decisions.·Chapter3-DynamicContentRecipes:Thefocusofthischapterisonillustratinghowyou can build user interfaces that process dynamic content.Typically, dynamic contentis form-based content, but not always.This chapter l lust rates validation techniques,dynamic layout, and state-management techniques.·Chapter4-ImplementinganSOAArchitecture:Thefocusofthischapterisonexplainingthe topics of SO A and REST-based Webservices in detail This chapter discusses the detailsof howto use the various HTTP verbs[such as GET and P DST) , howto test a Webservice, andhowto upgrade an already existing system to expose its functionality using REST.·Chapter5-ImplementingaUniversalWebServiceArchitecture:Thefocusofthischapteri son using a REST-based Webservice in a general context.This chapter illustratesthe techniques necessary to implement Webservices that you can integrate intoa mashup, to generate multiple data formats, and to integrate dynamic URLs into staticHTML pages.
CONTENTS·Chapter6-ImplementingWebServicesforLargeorSlowDataSets:Theforusofthischapter is on implementing REST-based Webservices for situations where you havemany results, or the results take along time to generate.The recipe in this chapterfocuses on solving one problem and l lust rates howto describe the data.implementthe URLs, and execute tasks on theserverside.·Chapter7-ImplementinganAjaxShoppingCart:Thefocusofthischapterisonthegeneral problem of the online shoppingcart.In the abstract sense.the problem withcurrent implementations of the shoppingcart is the association of data with a specificuser.This chapter illustrates how you can define and access non-user associated URLsusing authorization controL·ChapterB-DontSubmitYourForms-AjaxThem:Thefocusofthischapterisonsolving the dreaded back-button submit problem.The recipe illustrates howtomanage the form submittal process and associate state with an HTML page, allowingfor a more sophisticated content display
CHAPTER1GettingStartedI he focus of ths chapter is to provide solutions to some common, general problems andquestions that are bound to arise before or during development of Asynchronous JavaScriptand XML(Ajax) and Representational State Transfer(REST] applications.These commonquestions are not always technical in nature, often leaning more toward theory or philosophyof development.The problem with these kinds of questions is that once you begin to thinkabout them, you keep going in a circle and end up where you started.The trick to figuring out theanswers is not to keep going in a circle, but to stick with the assumptions and make a decision.Understanding the Definition and Philosophy of AjaxJesse James Garrett at Adaptive Path coined the original del inition'of Ajax.Quoting the originaldefinition, Ajax incorporates the following l eatures:interface of the Webbrowser is dynamically modified using a programming language thatretrieves data only when necessary, rather than the traditional approach of refreshing thewhole page everytime at equest is made.I want to highlight the terms d lynam ically and onlywhen necessary, because those terms are the essence of Ajax.Ajax and JavaScript are examplesof d luck typing and latent-type programming.