Tải bản đầy đủ (.pdf) (481 trang)

OReilly essential silverlight 2 up to date apr 2008 ISBN 0596519982

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (4.74 MB, 481 trang )

EssentialSilverlight2Up-to-Date
byChristianWenz
Publisher:O'Reilly
PubDate:April15,2008
PrintISBN-13:978-0-596-51998-8
Pages:212
TableofContents|Index

Overview
NowyoucandesignrichInternetapplications(RIAs)forthe
WebusingSilverlight2,thelatestversionofMicrosoft'shotnew
runtimeapplication--withoutwaitingfortheofficialrelease.
That'sright.WithEssentialSilverlight2Up-to-Date,younot
onlygetaconcise,easy-to-understandintroductionto
Silverlight2,butthoroughcoverageoftheCTPs,betas,and
RTMreleasesastheybecomeavailable.
OnceyoubuythisUp-to-Dateedition,you'llbeableto
downloadfreePDFsofalltherevisionstoSilverlight--pages
thatyoucanprintandinsertrightintothebook'suniquebinder
format.Pre-printedupdateswillalsobeavailableforpurchase.
Itcombinesthethespeedoftechnologywithconvenienceofa
book.
WithEssentialSilverlight2Up-to-Date,youlearntotake
advantageofMicrosoft'scross-browserSilverlightplug-inwith
toolsforanimation,vectorgraphics,andvideoplayback,aswell
asnew.NETsupportforwebservices,networkingandLINQ
(languageintegratedquery).Thisguidegivesyoucomplete
step-by-stepinstructionsforusingeverythingSilverlighthasto
offer,alongwith:
CleverwaystocreateinteractiveUIsthataremorerobust
andeasiertodebugandtestthanwhatyoucanachieveon


otherplatforms


ScoresoftestedJavaScriptandC#codeexamplesthatyou
canreuseinyourownapplications
ExpertguidancefromanauthorwhounderstandsRIA
technologies,includingASP.NET,Flash,PHP,andJavaScript
ReadytodeliveramorecompleteWebexperience?Nowthere's
noreasontowait.EssentialSilverlight2UptoDateoffersa
wholenewworldofpossibilities.


EssentialSilverlight2Up-to-Date
byChristianWenz
Publisher:O'Reilly
PubDate:April15,2008
PrintISBN-13:978-0-596-51998-8
Pages:212
TableofContents|Index

Copyright
Preface
Part1:Introduction
Chapter1.IntroducingSilverlight2
Section1.1.RichInternetApplications
Section1.2.RIATechnologies
Chapter2.IntroducingWPF
Section2.1.Vectors
Section2.2.WPF
Section2.3.XAML

Section2.4.FurtherReading
Chapter3.GettingStartedwithSilverlight2
Section3.1.SettingUpaSilverlightDevelopmentSystem
Section3.2.AFirstSilverlightExample:CreatingaWeb
Site
Section3.3.ASecondSilverlightExample:Creatinga
Project
Section3.4.FurtherReading
Chapter4.IntroducingSilverlightTools
Section4.1.XMLEditors
Section4.2.VectorGraphicsEditors
Section4.3.SilverlightIDEs
Section4.4.FurtherReading
Part2:DeclarativeSilverlight


Chapter5.IntroducingXAML
Section5.1.UsingText
Section5.2.UsingShapes
Section5.3.PositioningElements
Section5.4.UsingImages
Section5.5.UsingBrushes
Section5.6.FurtherReading
Chapter6.HandlingUserInteractionandEvents
Section6.1.EventsandEventHandlers
Section6.2.MouseEvents
Section6.3.KeyboardEvents
Section6.4.FurtherReading
Chapter7.TransformingandAnimatingContent
Section7.1.Transformations

Section7.2.Animations
Section7.3.FurtherReading
Chapter8.AddingSoundandVideo
Section8.1.PreparingMultimediaData
Section8.2.MediaElement
Section8.3.FurtherReading
Part3:ProgrammingSilverlightwith.NET
Chapter9.AddingSilverlightContenttoASP.NET3.5
Applications
Section9.1.EmbeddingXAML
Section9.2.EmbeddingMediaContent
Section9.3.FurtherReading
Part4:ProgrammingSilverlightwithJavaScript
Chapter10.AccessingSilverlightContentwithJavaScript
Section10.1.AccessingthePlug-in
Section10.2.CommunicatingwiththePlug-in
Section10.3.FurtherReading
Chapter11.SpecialSilverlightJavaScriptAPIs


Section11.1.AdvancedJavaScriptAPIs
Section11.2.DynamicallyDownloadingContent
Section11.3.UsingAdditionalFonts
Section11.4.FurtherReading
Part5:Appendix
AppendixA.SilverlightJavaScriptReference
SectionA.1.UsingtheSilverlightPlug-in
Colophon
Index



Copyright
Copyright©2008,O'ReillyMedia.Allrightsreserved.
PrintedintheUnitedStatesofAmerica.
PublishedbyO'ReillyMedia,Inc.,1005GravensteinHighway
North,Sebastopol,CA95472.
O'Reillybooksmaybepurchasedforeducational,business,or
salespromotionaluse.Onlineeditionsarealsoavailablefor
mosttitles().Formoreinformation,
contactourcorporate/institutionalsalesdepartment:(800)
998-9938or
Editor:JohnOsborn
Editor:LaurelR.T.Ruma
ProductionEditor:SarahSchneider
Editor:AudreyDoyle
NutshellHandbook,theNutshellHandbooklogo,andthe
O'ReillylogoareregisteredtrademarksofO'ReillyMedia,Inc.
EssentialSilverlight2Up-to-Date,theimageofacollared
pratincole,andrelatedtradedressaretrademarksofO'Reilly
Media,Inc.
Microsoft,MSDN,Windows,the.NETlogo,VisualStudio,Visual
C#,VisualBasic,IntelliSense,andSilverlightareregistered
trademarksortrademarksofMicrosoftCorporation.
Manyofthedesignationsusedbymanufacturersandsellersto
distinguishtheirproductsareclaimedastrademarks.Where
thosedesignationsappearinthisbook,andO'ReillyMedia,Inc.
wasawareoftrademarkclaims,thedesignationshavebeen
printedincapsorinitialcaps.
Whileeveryprecautionhasbeentakeninthepreparationofthis
book,thepublisherandauthorassumenoresponsibilityfor



errorsoromissions,orfordamagesresultingfromtheuseof
theinformationcontainedherein.


Preface
Iwouldconsidermyselfawebguy.WhenIfirstaccessedthe
WorldWideWebsometimearound1994,Iimmediatelyfellin
lovewithitspossibilitiesandtechnicalchallenges.Fromthen
on,Ialmostexclusivelyworkedonwebprojectsanddidvery
littleprogrammingapartfromthat.Astheyearshavepassed,I
haveseentechnologiescomeandgo,butsomeofthemstayed.
Forinstance,IrememberstartingtoworkwithASPandPHP
simultaneouslyaround1997or1998,andfinallymovingaway
fromASPbecauseitwassolimited.IreturnedtotheASPworld
whenthefirstbetasofASP.NETwerereleased,andmyinterest
heightenedwhenASP.NET2.0cameup,anditwasofftothe
racesagain.(Today,Iamhappilyusingboth.)Iappreciatethat
myJavaScriptknowledgeisindemandagain,thankstoone
newterm:Ajax.
OneofthetechnologiesIreallydevelopedalove-hate
relationshipwithwasMacromediaFlash(nowAdobeFlash).I
reallylikethatthetechnologycandosomuchmorethanHTML
andJavaScript,includingeverythingyouwanttocall"Ajax."I
amalsohappythatthebrowserplug-inhassuchanenormous
marketshare.Ireally,reallyhatetheFlasheditor.The
designersIworkwithareveryhappywithit,butfroma
developer'sperspective,Ichangeintoexplicitlyricsmode
wheneverIhavetouseit.Thisisprobablynosurprise:Flashis

historicallyadesigner'stoolandhasjustrecentlybegunto
appealtodevelopers.Iamaterribledesigner,soIprobablydo
notdeservebetter.
Butstill,Flashisaverynicetechnologybecauseitcombines
advancedgraphicalfeatureswithpowerfulcodingsupport.So,I
wasmorethanhappywhenIheardthatMicrosoftwasworking
onasimilartechnology:Silverlight.(NooneatMicrosoftwill
evertellyouthatthereisaconnectionbetweenSilverlightand
Flash,andthat'sprobablytrue,butitservestopointout
similaritiesanddifferences.)KnowingthatMicrosofthasalways
beenaverydeveloper-friendlycompany,IexpectedSilverlight


tohavethefeaturesofFlash,withabetterdevelopment
experience(atleastforme).And,tobehonest,thefirststeps
thatwerereleasedas"Silverlight1.0"werereallypromising.
MostprogrammingisdoneintrustedVisualStudio,butthere
aredesignertoolsaswell.Microsoftstillhasalongwaytogo,
withthetoolandmarketshare,butthefirststepsaredone,
andIlookforwardtoseeingthenextones.
AlthoughSilverlight1.0wasreleasedamerefewmonthsago
(inSeptember2007,tobeexact),Silverlight2isalreadyonthe
horizon.Thisbookfeaturesthelatest,prebetabuildof
Silverlight2.AsSilverlight2continuestoevolve,thisbookwill
adapttoeachnewversionaswell.Weplantoreleasean
updatetoEssentialSilverlight2Up-to-Datewheneveranew,
significantSilverlightreleasecomesoutoftheRedmondlabs.
OnceSilverlight2gosRTM,thisbookwillbeupdatedonelast
timeaswell.
Wedidourbesttobringyouup-to-dateinformationbyusing

sourceswithinMicrosofttogetanadvancelookatnewfeatures
andreleasesofSilverlight.However,untilthefinalbookisin
yourhands,someweekswillhavepassed,sotheremaybenew
releases,newfeatures,orsomefeaturesmightevenhavebeen
dropped.Wewillalwaystrytocomeupwithanewreleaseas
soonaspossible,andwilladderrataandlate-breakingchanges
onthebook'scatalogpageat
/>
P.1.WhoThisBookIsFor
Therearetwotargetaudiencesforthisbook:developerswho
wouldliketofamiliarizethemselveswiththeSilverlight
technology,anddesignerswhowouldliketoseewhat
Silverlighthastooffer.I'vechosentofocusonthedeveloper.
TruetothepromiseofanO'ReillyEssentialsbook,Essential
Silverlight2Up-to-Dateisnotacompletereferenceorin-depth
tutorial.Instead,youwillquicklylearnhowtogetSilverlight2
upandrunning,learnwhatthisnewplatformhastooffer,and


putitscapabilitiestothetestthroughthedozensofworking
codeexamples.SupportforSilverlightfromMicrosoftandthird
partiescontinuestogrow,andwheneverpossiblewepointyou
tosourcesForFurtherReadingthatyoucanturntofor
information.
ThisbookcoversSilverlight2.FordetailsonSilverlight1.0,you
canrefertomybookEssentialSilverlight1.0.Whileknowledge
ofWindowsPresentationFoundation(WPF)isnotrequired,if
youhavealreadyworkedwithit,ithasmanysimilaritieswith
theSilverlightUIframework.Fromaprogrammingpointof
view,JavaScriptandC#arethelanguagesofchoice.Ifyou

havenotworkedwitheitherlanguagebefore,refertothe
O'Reillycatalogforsomeexcellentchoices.

P.2.HowThisBookIsOrganized
Part1containsbackgroundinformationonSilverlightand
relatedtechnologies.
Chapter1
AbriefintroductiontoSilverlightandotherrichInternet
applications

Chapter2
IntroducesWPFandhowitrelatestoSilverlight

Chapter3
Goesthroughalltherequiredinstallationstepsandsteps
forcreatingyourfirstSilverlightapplication

Chapter4


Reviewssoftwaretoolsthatfacilitatethecreationof
Silverlightcontent
Part2focusesontheresultsyoucanachievewiththe
declarativemeansofSilverlight;butsomeC#codingwillalso
becovered

Chapter5
FeaturesthemostimportantelementsofMicrosoft'sWPF
markuplanguage


Chapter6
ExplainshowSilverlightapplicationsmaybecome
interactivebyprocessingevents

Chapter7
ExposestwodifferentapproachestomakingSilverlight
animationsdynamic

Chapter8
ShowshowtouseaudioandvideodatainSilverlight
applications,includingC#access
Part3focusesonC#developmentaspects.

Chapter9
ReviewswhichadditionalASP.NETwebcontrolsfacilitatethe


embeddingandcreationofSilverlightcontent
Part4focusesonJavaScriptdevelopmentaspects

Chapter10
DescribeshowtoaccessSilverlightcontentfromJavaScript

Chapter11
ShowsadvancedJavaScriptpossibilities,includingthe
abilitytomakeHTTPrequests

AppendixA
ProvidesalistofpropertiesandmethodstheSilverlight
plug-inexposes


P.3.WhatYouNeedtoUseThisBook
FordevelopingSilverlightcontent,youneedonlyatexteditor.
ItismuchmoreconvenientistouseVisualStudio2008orthe
(free)VisualWebDeveloperExpressEdition2008(however,the
formeroptionispreferable).Chapter3coverstheseand
additionaltools.Chapter2guidesyouthroughallthenecessary
installationstepsbothfordevelopingandforviewingSilverlight
content.

P.4.ConventionsUsedinThisBook
Thefollowingtypographicalconventionsareusedinthisbook:

Italic


Indicatesnewterms,URLs,emailaddresses,filenames,and
fileextensions.

Constantwidth
Usedforprogramlistings,aswellaswithinparagraphsto
refertoprogramelementssuchasvariableorfunction
names,databases,datatypes,environmentvariables,
statements,andkeywords.

Constantwidth
bold
Showscommandsorothertextthatshouldbetyped
literallybytheuser.


Constantwidthitalic
Showstextthatshouldbereplacedwithuser-supplied
valuesorbyvaluesdeterminedbycontext.
Thisiconsignifiesatip,suggestion,orgeneral
note.

Thisiconindicatesawarningorcaution.

P.5.UsingCodeExamples
Thisbookisheretohelpyougetyourjobdone.Ingeneral,you


mayusethecodeinthisbookinyourprogramsand
documentation.Youdonotneedtocontactusforpermission
unlessyou'rereproducingasignificantportionofthecode.For
example,writingaprogramthatusesseveralchunksofcode
fromthisbookdoesnotrequirepermission.Sellingor
distributingaCD-ROMofexamplesfromO'Reillybooksdoes
requirepermission.Answeringaquestionbycitingthisbook
andquotingexamplecodedoesnotrequirepermission.
Incorporatingasignificantamountofexamplecodefromthis
bookintoyourproduct'sdocumentationdoesrequire
permission.
Weappreciate,butdonotrequire,attribution.Anattribution
usuallyincludesthetitle,author,publisher,andISBN.For
example:"EssentialSilverlight2Up-to-DatebyChristianWenz.
Copyright2008O'ReillyMedia,Inc.,978-0-596-519-988."
Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseor
thepermissiongivenhere,feelfreetocontactusat



P.6.HowtoContactUs
Pleaseaddresscommentsandquestionsconcerningthisbookto
thepublisher:
O'ReillyMedia,Inc.
1005GravensteinHighwayNorth
Sebastopol,CA95472
800-998-9938(intheUnitedStatesorCanada)
707-829-0515(internationalorlocal)
707829-0104(fax)
Wehaveawebpageforthisbook,wherewelisterrata,
examples,andanyadditionalinformation.Youcanaccessthis
pageat:
/>

Registerthisbookforupdatesat:

Tocommentorasktechnicalquestionsaboutthisbook,send
emailto:

Formoreinformationaboutourbooks,conferences,Resource
Centers,andtheO'ReillyNetwork,seeourwebsiteat:


ackP.7.Acknowledgments
Ihaveexpressedthethoughtonvariousoccasionsthat
technicalbookauthorsshouldnotthanktheir
partners/kids/dogsandpretendthatwritingabookputtheir
privateandsociallivesatrisk.Inprefacesoffictionormemoirs
youneverreadsuchcomplaints,butintechnicalbooksthey

seemtobealltoocommon.Ihavewrittenseveraldozensof
thoseandalwaysmanagedtojuggleworkandplay.
Thistime,however,Iunderstood.Iwrotethisbookonan
extremelytoughschedulesothatitcouldbepublishedintime
fortheSilverlightrelease.So,Ihadtoworkcrazyhoursand
neglectsomethingsandsomepeople.(NotthatIhaven'tdone
thatinthepast,butthistimeitwasworsethanusual.)
Therefore,thankstoallwhosufferedinonewayoranother—
youknowwhoyouare.
IalsohavetothankmyeditoratO'Reilly,JohnOsborn,for
joiningforceswithmeagain.AndrewSavikasgotmesetup
withDocBookandalsotriedtoconvincemethatwritingabook
inXMLwasnottoobad(Istillwantmywordprocessorback).
KeithFahlgrenandAbbyFoxsetuptheSubversionrepository,
implementedtheautomatedPDFbuild,andalsocleanedupmy
DocBookmessfromtimetotime.LaurelRumaandAudrey


Doylecopyeditedthetext,andIdon'tknowwhichtheycursed
more:mywritingormyXML.YvonneSchimmerprovidedme
withvideomaterialforthechapteronmultimediaand
supportedtherestofthebookaswell.
Thisbookwouldnothavebeenpossiblewithoutthesupport
frompeoplewithinMicrosoftwhoprovidedmeaccessto
previewbitsofSilverlightandadditional,nonofficialresources.
ThesepeopleincludeScottGuthrie,BrianGoldfarb,and
especiallyChungWebster.Thankyouverymuchforyourtrust
andsupport.



Part1:Introduction


Chapter1.IntroducingSilverlight2
SilverlightisMicrosoft'snewbrowser-basedplug-infor
deliveringricherinteractiveapplicationstousersovertheweb.
Silverlight2isMicrosoft'ssecondreleaseoftheSilverlight
platform.Silverlight2'sbiggestchangefromSilverlight1.0is
theinclusionofacompactversionofthe.NETFramework,
completewiththe.NETFramework3.0CommonLanguage
Runtime.Byadding.NETtoSilverlight,Microsoftmakesiteasy
for.NETdeveloperstoreusetheirexistingprogrammingskills,
collaboratewithdesigners,andquicklycreaterichapplications
fortheWeb.
AndeventhoughSilverlight2brings.NETtotheclient,itcan
beintegratedeasilywithmanyexistingWebtechnologiesand
backendWebplatforms.ThatmeansSilverlightwillintegrate
withyourexistinginfrastructureandapplications,fromIISand
.NETtoApacheandPHPtosimpleJavaScriptandXHTMLonthe
client.Silverlightisnotatoolmeantforexclusiveuseon
ASP.NETwebsites,whichshouldresultinbroaderadoptionof
thenewtechnology.
Still,oneofthekeybenefitsofSilverlight2isthatitcan
executeany.NETlanguage,includingC#andVB.NET.Unlike
theCLRincludedwiththe"normal".NETFramework,multiple
instancesofthecore"SilverlightCLR"canbehostedinasingle
process.Withthis,thelayoutmarkupintheSilverlightXAML
file(.xamlfile)canbeaugmentedbycode-behindcodewithall
programminglogicwritteninany.NETlanguage.
Silverlight2shipswitha"lightweight"versionofthefull.NET

Framework,whichfeatures,amongotherclasses,extensible
controls,XMLWebServices,networkingcomponents,andLINQ
APIs.Thisclasslibraryisasubsetof(andisconsiderably
smallerthan)the.NETFramework'sBaseClassLibrary,which
enablestheSilverlightplug-intobeafastandsmalldownload.
Forsecurity,allSilverlightcoderunsinasandboxenvironment
thatpreventsinvokingplatformAPIs,protectingusercomputers


frommaliciouscode.Silverlight2alsoaddssupportforDRMin
mediafiles,afactthatwillmakesomepeoplehappyandothers
cringe.
Inadditiontothe.NETFrameworkclasses,Silverlight2also
shipswithasubsetoftheWPFUIprogrammingmodel,
includingsupportforshapes,documents,media,andWPF
animationobjects.TheSilverlight2DecemberCTPdidnotship
withmanyWPFUIcontrols,though,soout-of-the-boxcontrols
willremainlimiteduntilbeta1.TheSilverlight2beta1release
promisestodelivermorecontrolsaswellastheabilitytobind
todata.Microsoftsaysthatthedatabindinglimitationsare
strictlytemporaryandthatfuturebuildsofSilverlight2will
eliminatetheproblem.CountonfutureSilverlightreleasesto
addmoreUIcontrols,databindingsupport,andamuchneeded
automatedlayoutmanagertotheSilverlightmix(seeFigure11).
ThearchitectureofSilverlight1.0isquitecomplex(see
for
anoverview),butitcanbebrokendownintobigchunks.The
presentationsystemtakescareofeverythingUI,including
animation,textrendering,andaudio/videoplayback.Thepluginitselfintegratesintothebrowsersothatthecontentcanbe
shown,aswellasaccessedusingtheJavaScriptDOM.Finally,

usingsomeJavaScriptcode(or,optimally,theASP.NETAJAX
framework),Silverlightapplicationscanbeenrichedtoaccess
serverAPIssuchaswebservices.Thebrowserplug-inthen
parsesthemarkupandrunsthecode,evenifno.NET
FrameworkRedistributableisinstalledontheclient.Silverlight2
furtherextendsthisandoffersapartial.NETFramework
integrationrightintoSilverlight.Soyoucanwritecodein
languagessuchasC#;thiscodewillbecompiledpriorto
deployment.
Figure1-1.Silverlightframeworkmodel


1.1.RichInternetApplications
Whatexactlyisa"RIA"webapplication?Andwhywouldyou
wanttoadopttheRIAmodelforyourownwebdevelopment?
RichInternetApplications,orRIAs,arewebapplicationsthat
havethefeaturesandfunctionalityoftraditionaldesktop
applications.RIAstypicallytransfertheprocessingnecessary


fortheuserinterfacetothewebclientbutkeepthebulkofthe
dataprocessing(suchasmaintainingthestateoftheprogram,
thedata,etc.)ontheapplicationserver.
Traditionalwebapplicationsimplementaclient/server
architecture,inwhichathinclient(thewebbrowser)interacts
withapowerfulserver.Typically,allprocessingisdoneonthe
serverandtheclientisusedonlytodisplaystaticHTML
content.Thebiggestdrawbacktothin-clientimplementationsis
thatallinteractionwiththeapplicationmustpassthroughthe
server.Thatmeansdatamustbesenttotheserver,theserver

mustrespond,andthenthepagemustbereloadedonthe
clientwiththeserver'sresponse.Bymovingmoreofthis
processingtoclient-sidetechnologythatcanexecute
instructionsontheclient'scomputer,RIAscancircumventthis
slow,synchronousloopformanyuserinteractions.

1.1.1.BenefitsofRichInternetApplications
OneoftheprimarybenefitsofRIAsisthattheycanofferuserinterfacebehaviorsnotpossiblewithonlytheHTMLcontrols
availableinstandardbrowser-basedwebapplications.Witha
RIAplatform,webapplicationsarenolongerlimitedbywhat
thebrowsercando.Rather,theycanimplementanyuser
interactionthatthenewRIAplatformsupport,suchasdragand-dropbehaviors,smoothanimations,andclient-side
calculations.Whilesomeoftheseinteractionsarepossible
withoutaRIAplatform(usingAjax,forexample),theRIA
approachistypicallymuchmoreresponsiveandconsistent
acrossplatforms.
ThebenefitsofRIAs,however,gobeyondtheirlooks.Usinga
clientenginecanalsoproduceotherperformancebenefits:

Client-serverbalance
RIAsshiftthebalanceofcomputingresourcesforweb


applicationsfromtheservertotheclient.Thisfreesup
resourcesonthewebserver,enablingthesameserver
hardwaretohandlemoreconcurrentusersessions.Onthe
flipside,theapprovalitrequiresthatyourusershave
computersthatarepowerfulenoughtoexecutecomplex
client-sidecode,whichisgenerallynotaprobleminthis
dayandage.


Asynchronouscommunication
TheRIAclientenginecaninteractwiththeserver
asynchronously—thatis,withoutwaitingfortheuserto
performanactionsuchasclickingonabuttonorlink.This
featureenablesRIAdesignerstomovedatabetweenthe
user'sPCandtheserverwithoutmakingtheuserwaitfor
thetransfertofinish,similartowhatAjaxprovidestoday.

Networkefficiency
NetworktrafficmayalsobesignificantlyreducedinaRIA
becauseanapplication-specificclientenginecanbemore
intelligentthanastandardwebbrowserwhendecidingwhat
dataneedstobeexchangedwithservers.Transferringless
dataforeachinteractioncanspeedupindividualrequests
andresponses,inturnreducingoverallnetworkload.Useof
asynchronousprefetchingtechniques,however,can
neutralizeorevenreversethispotentialbenefit.Because
codecannotanticipateexactlywhateveryuserwilldonext,
prefetchingextradataiscommon,notallofwhichis
actuallyneededbymanyusers.

1.1.2.ShortcomingsofRichInternetApplications
WhileRIAsoffersomecompellingadvantagesovercurrent
approachestowebdevelopment,thereareanumberof
drawbacksthatplaguethetechnology—nottheleastofwhich


arerequirementsofthebrowserplug-initself(inmostcases).
AmongthemoreseriousdrawbacksofRIAsare:


Sandbox
BecauseRIAsrunwithinasandbox,theyhaverestricted
accesstosystemresources.Ifusersmodifytheirsystems
orhavereducedpermissionsthatalteraRIA'sabilityto
accesssystemresources,RIAsmayfailtooperatecorrectly.

Disabledscripting
RIAsusuallyrequireJavaScriptoranotherscripting
languagetooperateontheclient.Iftheuserhasdisabled
activescriptinginhisbrowser,theRIAmaynotfunction
properly,ifatall.

Scriptdownloadtime
Althoughitdoesnotalwayshavetobeinstalled,the
additionalclient-sideintelligence(orclientengine)ofRIA
applicationsneedstobedeliveredbytheservertothe
client.Whilemuchofthisisusuallyautomaticallycached,it
needstobetransferredatleastonce.Dependingonthe
sizeandtypeofdelivery,clientenginedownloadtimemay
beunpleasantlylong,especiallyforuserswithslower
Internetconnections.SomeRIAdeveloperscanlessenthe
impactofthisdelaybycompressingscriptsandbystaging
deliveryovermultiplepagesofanapplication.Forclient
enginesthatrequireaplug-intobeinstalled,thisisnotan
option.

Lossofvisibilitytosearchengines



Searchenginesmaynotbeabletoindexthetextcontentof
RIAapplications.Thiscanbeamajorproblemforweb
applicationsthatdependonsearchenginevisibilityfortheir
success.

DependenceonanInternetconnection
Whiletheidealnetwork-enabledreplacementforadesktop
applicationwouldallowuserstobe"occasionally
connected,"wanderinginandoutofhotspotsorfromoffice
tooffice,today(in2008)thetypicalRIArequiresnetwork
connectivity.


Part1:Introduction


×