Tải bản đầy đủ - 0 (trang)
Chapter 1. Introduction to Adobe AIR

Chapter 1. Introduction to Adobe AIR

Tải bản đầy đủ - 0trang

WiththematurationoftheFlashPlayerruntime,however,and

morerecentlywithAjax-typefunctionalityinthebrowser,it

becamepossiblefordeveloperstobegintobreakawayfrom

page-basedapplicationflows.Developersbegantoofferricher

applicationexperiencesviathebrowser.Inawhitepaperfrom

March2002,MacromediacoinedthetermrichInternet

applicationtodescribethesenewtypesofapplicationsin

browsers,which"blendcontent,applicationlogicand

communications...tomaketheInternetmoreusableand

enjoyable."Theseapplicationsprovidedricher,moredesktoplikeexperiences,whilestillretainingthecorecross-platform

natureoftheWeb:

Internetapplicationsareallaboutreach.Thepromiseofthe

webisoneofcontentandapplicationsanywhere,regardless

oftheplatformordevice.Richclientsmustembraceand

supportallpopulardesktopoperatingsystems,aswellas

thebroadestrangeofemergingdeviceplatformssuchas

smartphones,PDAs,set-topboxes,gameconsoles,and

Internetappliances.



NOTE



Youcanfindthecompletewhitepaperandmore

informationonRIAsat

http://download.macromedia.com/pub/flash/whitepapers/richclient.pd

ThepapergoesontolistsomefeaturesthatdefineRIAs:

Provideanefficient,high-performanceruntimefor

executingcode,content,andcommunications

Integratecontent,communications,andapplication

interfacesintoacommonenvironment

Providepowerfulandextensibleobjectmodelsfor

interactivity



Enablerapidapplicationdevelopmentthroughcomponents

andreuse

Enabletheuseofwebanddataservicesprovidedby

applicationservers

Embraceconnectedanddisconnectedclients

Enableeasydeploymentonmultipleplatformsanddevices

Thismovementtowardprovidingricher,moredesktop-like

applicationexperiencesinthebrowser(enabledbytheFlash

Playerruntime,andmorerecentlybyAjax)hasledtoan

explosionofwebapplications.

Today,thewebhasfirmlyestablisheditselfasanapplication

deploymentplatformthatoffersbenefitstobothdevelopersand

end-users.Someofthesebenefitsincludetheabilityto:

Targetmultipleplatformsandoperatingsystems

Developwithrelativelyhigh-levelprogrammingandlayout

languages

Allowend-userstoaccesstheirapplicationsanddatafrom

virtuallyanyInternet-connectedcomputer

Easilypushapplicationupdatestousers

ThegrowthofwebapplicationscanbeseeninboththeWeb2.0

trend,whichconsistsalmostentirelyofweb-basedapplications

andAPIs,andtheadoptionofwebapplicationsasacore

businessmodelbymajorcompaniesandorganizations.



Chapter1.IntroductiontoAdobeAIR

AdobeAIRisacross-platformdesktopruntimecreatedby

Adobethatallowswebdeveloperstousewebtechnologiesto

buildanddeployRichInternetApplications(RIAs)andweb

applicationstothedesktop.



NOTE

Duringitsdevelopmentcycle,AdobeAIRwasreferred

toinpublicbyitscodenameof"Apollo".

TobetterunderstandwhatAdobeAIRenables,andwhich

problemsittriestoaddress,itisusefultofirsttakealookat

the(relativelyshort)historyofwebapplications.



1.1.AShortHistoryofWebApplications

Overthepastcoupleofyears,therehasbeenanaccelerating

trendofapplicationsmovingfromthedesktoptotheweb

browser.Thishasbeendrivenbyanumberoffactors,which

include:

GrowthoftheInternetasacommunicationmedium

Relativeeaseofdeploymentofwebapplications

Abilitytotargetmultipleoperatingsystemsviathebrowser

Maturityofhigher-levelclienttechnologies,suchasthe

browserandtheFlashPlayerruntime

EarlywebapplicationswerebuiltprimarilywithHTMLand

JavaScript,which,forthemostpart,reliedheavilyon

client/serverinteractionsandpagerefreshes.Thispagerefresh

modelwasconsistentwiththedocument-basedmetaphorfor

whichthebrowserwasoriginallydesigned,butprovideda

relativelypooruserexperiencewhendisplayingapplications.



WiththematurationoftheFlashPlayerruntime,however,and

morerecentlywithAjax-typefunctionalityinthebrowser,it

becamepossiblefordeveloperstobegintobreakawayfrom

page-basedapplicationflows.Developersbegantoofferricher

applicationexperiencesviathebrowser.Inawhitepaperfrom

March2002,MacromediacoinedthetermrichInternet

applicationtodescribethesenewtypesofapplicationsin

browsers,which"blendcontent,applicationlogicand

communications...tomaketheInternetmoreusableand

enjoyable."Theseapplicationsprovidedricher,moredesktoplikeexperiences,whilestillretainingthecorecross-platform

natureoftheWeb:

Internetapplicationsareallaboutreach.Thepromiseofthe

webisoneofcontentandapplicationsanywhere,regardless

oftheplatformordevice.Richclientsmustembraceand

supportallpopulardesktopoperatingsystems,aswellas

thebroadestrangeofemergingdeviceplatformssuchas

smartphones,PDAs,set-topboxes,gameconsoles,and

Internetappliances.



NOTE



Youcanfindthecompletewhitepaperandmore

informationonRIAsat

http://download.macromedia.com/pub/flash/whitepapers/richclient.pd

ThepapergoesontolistsomefeaturesthatdefineRIAs:

Provideanefficient,high-performanceruntimefor

executingcode,content,andcommunications

Integratecontent,communications,andapplication

interfacesintoacommonenvironment

Providepowerfulandextensibleobjectmodelsfor

interactivity



Enablerapidapplicationdevelopmentthroughcomponents

andreuse

Enabletheuseofwebanddataservicesprovidedby

applicationservers

Embraceconnectedanddisconnectedclients

Enableeasydeploymentonmultipleplatformsanddevices

Thismovementtowardprovidingricher,moredesktop-like

applicationexperiencesinthebrowser(enabledbytheFlash

Playerruntime,andmorerecentlybyAjax)hasledtoan

explosionofwebapplications.

Today,thewebhasfirmlyestablisheditselfasanapplication

deploymentplatformthatoffersbenefitstobothdevelopersand

end-users.Someofthesebenefitsincludetheabilityto:

Targetmultipleplatformsandoperatingsystems

Developwithrelativelyhigh-levelprogrammingandlayout

languages

Allowend-userstoaccesstheirapplicationsanddatafrom

virtuallyanyInternet-connectedcomputer

Easilypushapplicationupdatestousers

ThegrowthofwebapplicationscanbeseeninboththeWeb2.0

trend,whichconsistsalmostentirelyofweb-basedapplications

andAPIs,andtheadoptionofwebapplicationsasacore

businessmodelbymajorcompaniesandorganizations.



1.2.ProblemswithDelivering

ApplicationsviatheBrowser

Aswebapplicationshavebecomemorecomplex,theyhave

beguntopushtheboundariesofboththecapabilitiesofthe

browserandtheusabilityoftheapplication.Astheirpopularity

grows,theseissuesbecomemoreapparentandimportantand

highlightthefactthattherearestillanumberofsignificant

issuesforbothdevelopersandend-userswhendeployingand

usingapplicationswithinthebrowser.

Thewebbrowserwasoriginallydesignedtodeliveranddisplay

HTML-baseddocuments.Indeed,thebasicdesignofthe

browserhasnotshiftedsignificantlyfromthispurpose.This

fundamentalconflictbetweendocument-andapplicationfocusedfunctionalitycreatesanumberofproblemswhen

deployingapplicationsviathebrowser.



1.2.1.ConflictingUI

Applicationsdeployedviathebrowserhavetheirownuser

interface,whichoftenconflictswiththeuserinterfaceofthe

browser.Thisapplication-within-an-applicationmodeloften

resultsinuserinterfacesthatconflictwithandcontradicteach

other.Thiscanleadtouserconfusioninthebestcases,and

applicationfailureintheworstcases.Theclassicexampleof

thisisthebrowser'sBackbutton.TheBackbuttonmakessense

whenbrowsingdocuments,butitdoesnotalwaysmakesense

inthecontextofanapplication.Althoughanumberofsolutions

attempttosolvethisproblem,theyareappliedtoapplications

inconsistently,andusersmaynotknowwhetheraspecific

applicationsupportstheBackbuttonorwhetheritwillforce

theirapplicationtounload,causingittoloseitsstateanddata.



1.2.2.DistancefromtheDesktop

Dueinparttothewebsecuritymodel(whichrestrictsaccessto

theuser'smachine),applicationsthatruninthebrowseroften



donotsupportthetypesofuserinteractionswiththeoperating

systemthatpeopleexpectfromapplications.Forexample,you

cannotdragafileintoabrowser-basedapplicationandhavethe

applicationactonthatfile.Norcanthewebapplicationinteract

withotherapplicationsontheuser'scomputer.

RIAshavetriedtoimproveonthisbymakingricher,more

desktop-likeinterfacespossibleinthebrowser,buttheyhave

notbeenabletoovercomethefundamentallimitationsand

separationofthebrowserfromthedesktop.



1.2.3.PrimarilyOnlineExperience

Becausewebapplicationsaredeliveredfromaserveranddo

notresideontheuser'smachine,webapplicationsareprimarily

anonlineexperience.Althoughattemptsareunderwaytomake

offlineweb-basedapplicationspossible,theydonotprovidea

consistentdevelopmentmodelandtheyfailtoworkacross

differentbrowsers,ortheyrequireuserstoinstalladditional

extensionstothebrowser.Inaddition,theyoftenrequireusers

tointeractwithandmanagetheirapplicationandbrowserin

complexandunexpectedways.



1.2.4.LowestCommonDenominator

Finally,asapplicationsbecomericherandmorecomplexand

begintopushtheboundariesofJavaScriptandDHTML,

developersareincreasinglyfacedwithdifferencesinbrowser

functionalityandAPIimplementations.Althoughtheseissues

canoftenbeovercomewithbrowser-specificcode,theyleadto

codethata)ismoredifficulttomaintainandscale;andb)

takestimeawayfromfunction-drivendevelopmentoffeature

functionality.

AlthoughJavaScriptframeworksareapopularwaytohelp

addresstheseissues,theycanofferonlythefunctionality

providedbythebrowser,andoftentheyresorttothelowest

commondenominatoroffeaturesamongbrowserstoeasethe

developmentmodel.TheresultforJavaScript-orDHTML-based



applicationsisalowestcommondenominatoruserexperience

andinteractionmodel,aswellasincreaseddevelopment,

testing,anddeploymentcostsforthedeveloper.

Thefactthatwebapplicationshaveflourisheddespitethese

drawbacksisatestamenttotheattractivenessofhavinga

platformwithagooddevelopmentmodelthathastheabilityto

deliverapplicationstomultipleoperatingsystems.Aplatform

thatofferedthereachanddevelopmentmodelofthebrowser,

whileprovidingthefunctionalityandrichnessofadesktop

application,wouldprovidethebestofbothworlds.Thisiswhat

AdobeAIRaimstoprovide.



1.3.IntroducingAdobeAIR

So,whatisAdobeAIR,andhowcanitmakewebapplication

developmentanddeploymentbetter?

AdobeAIRisacross-operating-systemruntimedevelopedby

Adobethatallowswebdeveloperstoleveragetheirexistingweb

developmentskills(suchasFlash,Flex,HTML,JavaScript,and

PDF)tobuildanddeployRIAsandcontenttothedesktop.

Inessence,AdobeAIRprovidesaplatforminbetweenthe

desktopandthebrowser,whichcombinesthereachandeaseof

developmentofthewebmodelwiththefunctionalityand

richnessofthedesktopmodel.

Itisimportanttostepbackforasecondandpointoutwhat

AdobeAIRisnot.AdobeAIRisnotageneraldesktopruntime

meanttocompetewithlower-levelapplicationruntimes.Adobe

AIRiscomingfromtheWebtothedesktopandistargetedat

webdevelopers.Itsprimaryusecaseistoenableweb

applicationsandRIAstobedeployedtothedesktop.Thisisa

veryimportantbutsubtledistinction,asenablingweb

applicationsandRIAsonthedesktopistheprimaryusecase

drivingtheAdobeAIR1.0featureset.

Atitscore,AdobeAIRisbuiltontopofwebtechnologies,which

allowwebdeveloperstodevelopforanddeploytothedesktop

usingthesametechnologiesanddevelopmentmodelsthatthey

usetodaywhendeployingapplicationsontheWeb.



1.4.PrimaryAdobeAIRTechnologies

ThreeprimarytechnologiesareincludedwithinAdobeAIR,and

theyfallintotwodistinctcategories:applicationtechnologies

anddocumenttechnologies.



1.4.1.PrimaryApplicationTechnologies

Applicationtechnologiesaretechnologiesthatcanbeusedas

thebasisofanapplicationwithinAdobeAIR.AdobeAIR

containstwoprimaryapplicationtechnologies,HTMLandFlash,

bothofwhichcanbeusedontheirowntobuildanddeploy

AdobeAIRapplications.



1.4.1.1.HTML/JavaScript

ThefirstcoreapplicationtechnologywithinAdobeAIRisHTML

andJavaScript.ThisincludesafullHTMLrenderingengine,

whichincludessupportfor:

HTML

JavaScript

CSS

XHTML

DocumentObjectModel(DOM)

Yes,youreadthatright.Youdon'thavetouseFlashtobuild

AdobeAIRapplications.Youcanbuildfull-featuredapplications

usingjustHTMLandJavaScript.Thisusuallysurprisessome

developerswhoexpectAdobeAIRtofocusonlyonFlash.

However,atitscore,AdobeAIRisaruntimetargetedatweb

developersusingwebtechnologies—andwhatismoreofaweb

technologythanHTMLandJavaScript?

TheHTMLengineusedwithinAdobeAIRistheopensource

WebKitengine.Thisistheenginebehindanumberofbrowsers,



includingKHTMLonKDEandSafarionMacOSX.



NOTE

YoucanfindmoreinformationontheWebKitopen

sourceprojectathttp://www.webkit.org.

SeeChapter3foramorein-depthdiscussionofWebKit

withinAdobeAIR.



1.4.1.2.AdobeFlash

ThesecondcoreapplicationtechnologythatAdobeAIRisbuilt

onisAdobeFlashPlayer.Specifically,AdobeAIRisbuiltontop

ofAdobeFlashPlayer9,whichincludestheECMAScript-based

ActionScript3scriptinglanguage,aswellastheopensource

Tamarinvirtualmachine(whichwillbeusedtointerpret

JavaScriptinfutureversionsofFirefox).



NOTE

Youcanfindmoreinformationontheopensource

TamarinprojectontheMozillawebsite,at

http://www.mozilla.org/projects/tamarin/.

NotonlyarealloftheexistingFlashPlayerAPIsavailablewithin

AdobeAIR,butsomeofthoseAPIshavealsobeenexpanded

and/orenhanced.SomeofthefunctionalitythattheFlash

PlayerprovidestoAdobeAIRincludes:

Just-in-timeInterpretedActionScriptengineforspeedy

applicationperformance

Fullnetworkingstack,includingHTTPandRTMP,aswellas

BinaryandXMLsockets

Completevector-basedrenderingengineanddrawingAPIs

Extensivemultimediasupportincludingbitmaps,vectors,



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 1. Introduction to Adobe AIR

Tải bản đầy đủ ngay(0 tr)

×