计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx

上传人:b****5 文档编号:18306416 上传时间:2022-12-15 格式:DOCX 页数:15 大小:202.38KB
下载 相关 举报
计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx_第1页
第1页 / 共15页
计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx_第2页
第2页 / 共15页
计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx_第3页
第3页 / 共15页
计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx_第4页
第4页 / 共15页
计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx

《计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx》由会员分享,可在线阅读,更多相关《计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx(15页珍藏版)》请在冰豆网上搜索。

计算机系 Java EE 外文翻译 外文文献 英文文献Word下载.docx

(5)AnoverviewofhowtobuildFlexapplicationsusingevents,states,MXMLcomponents,andmodules.

(6)AnintroductiontodevelopingaFlexapplicationwithreal-timeserverdatapush.

(7)Howtoboostproductivitydevelopingdata-intensiveapplicationsusingtheDataManagementserviceinLiveCycleDataServices.

(8)AnoverviewofmodeldrivendevelopmentusingFlashBuilderandLiveCycleDataServicestogenerateclientandserver-sidecode.

(9)HowtodeployaFlexapplicationonaportalserver.

(10)BesuretoalsowatchthevideoIntroductiontoFlex4andJavaintegration.

(11)Tolearnmoreaboutthetechnologiesusedtobuildtheseapplications,readThetechnologiesforbuildingFlexandJavaapplicationsarticle.

Client/serverarchitecture

FlexandJavaapplicationsuseamulti-tierarchitecturewherethepresentationtieristheFlexapplication,thebusinessorapplicationtieristheJavaEEserverandcode,andthedatatieristhedatabase.Youcanwritetheback-endcodejustasyounormallywouldforaJavaapplication,modelingyourobjects,definingyourdatabase,usinganobject-relationalframeworksuchasHibernateorEJB3,andwritingthebusinesslogictoqueryandmanipulatetheseobjects.ThebusinesstiermustbeexposedforaccessviaHTTPfromtheFlexapplicationandwillbeusedtomovethedatabetweenthepresentationanddatatiers.

TypicalHTMLapplicationsconsistofmultiplepagesandasausernavigatesbetweenthem,theapplicationdatamustbepassedalongsotheapplicationitself(thecollectionofpagesandfunctionalityitconsistsof)canmaintainstate.Incontrast,Flexapplications,bynature,arestateful.AFlexapplicationisembeddedinasingleHTMLpagethattheuserdoesnotleaveandisrenderedbyFlashPlayer.TheFlexapplicationcandynamicallychangeviewsandsendandretrievedataasynchronouslytotheserverinthebackground,updatingbutneverleavingthesingleapplicationinterface(seeFigure1)(similartothefunctionalityprovidedbytheXMLHttpRequestAPIwithJavaScript.)

Figure1.Theclient/serverarchitecture.

Client/servercommunication

Flexapplicationscancommunicatewithback-endserversusingeitherdirectsocketconnectionsormorecommonly,throughHTTP.TheFlexframeworkhasthreeremoteprocedurecallAPIsthatcommunicatewithaserveroverHTTP:

HTTPService,WebService,andRemoteObject.AllthreewrapFlashPlayer'

sHTTPconnectivity,whichinturn,usesthebrowser'

sHTTPlibrary.Flexapplicationscannotconnectdirectlytoaremotedatabase.

YouuseHTTPServicetomakeHTTPrequeststoJSPorXMLfiles,toRESTfulwebservices,ortootherserverfilesthatreturntextoverHTTP.YouspecifytheendpointURL,listenerfunctions(thecallbackfunctionstobeinvokedwhentheHTTPServicerequestreturnsasuccessfulorunsuccessfulresponse),andadatatypeforthereturneddata(whattypeofdatastructureitshouldbetranslatedintooncereceivedintheFlexapplication).YoucanspecifythedatatobehandledasrawtextandassignedtoaStringvariableorconvertedtoXML,E4X,orplainoldActionScriptobjects.IfyougetbackJSON,youcanusetheAdobeFlexcorelibpackageofclassestodeserializetheJSONobjectsintoActionScriptobjects.TomakecallstoSOAPbasedwebservices,youcanusetheHTTPServiceAPIorthemorespecializedWebServiceAPI,whichautomaticallyhandlestheserializationanddeserializationofSOAPformattedtexttoActionScriptdatatypesandviceversa.

ThethirdoptionformakingremoteprocedurecallsistousetheRemoteObjectAPI.ItmakesaFlashRemotingrequesttoamethodofaserver-sideJavaclassthatreturnsbinaryActionMessageFormatoverHTTP.Whenpossible,useFlashRemotingwhosebinarydatatransferformatenablesapplicationstoloaddataupto10timesfasterthanwiththemoreverbose,text-basedformatssuchasXML,JSON,orSOAP(seeFigure2).ToseeacomparisonofAMFtoothertext-basedserializationtechnologies,seeJamesWard'

sCensusRIABenchmarkapplication.

Figure2.MethodsforconnectingFlexandJava.

FlashRemoting

FlashRemotingisacombinationofclientandserver-sidefunctionalitythattogetherprovidesacall-and-responsemodelforaccessingserver-sideobjectsfromFlashPlatformapplicationsasiftheywerelocalobjects.ItprovidestransparentdatatransferbetweenActionScriptandserver-sidedatatypes,handlingtheserializationintoActionMessageFormat(AMF),deserialization,anddatamarshalingbetweentheclientandtheserver.

FlashRemotingusesclient-sidefunctionalitybuiltintoFlashPlayerandserver-sidefunctionalitythatisbuiltintosomeservers(likeColdFusionandZend)butmustbeinstalledonotherservers(asBlazeDSorLiveCycleDataServicesonJavaEEservers,WebORBorFluorineFXon.NETservers,theZendframeworkoramfphponPHPservers,andmore).SeethetechnologiesforbuildingFlexandJavaapplicationsarticleformoredetailsaboutBlazeDSandLiveCycleDataServices.

BlazeDSandLiveCycleDataServicesuseamessage-basedframeworktosenddatabackandforthbetweentheclientandserver.TheyprovideRemoting,Proxying,andMessagingservices,andforLiveCycle,anadditionalDataManagementservice.TheFlexapplicationsendsarequesttotheserverandtherequestisroutedtoanendpointontheserver.Fromtheendpoint,therequestispassedtotheMessageBroker,theBlazeDSandLiveCycleDataServicesenginethathandlesalltherequestsandroutesthemthroughachainofJavaobjectstothedestination,theJavaclasswiththemethodtoinvoke(seeFigure3).

Figure3.FlashRemotingarchitecture.

AMF

AMFisabinaryformatusedtoserializeActionScriptobjectsandfacilitatedataexchangebetweenFlashPlatformapplicationsandremoteservicesovertheInternet.Adobepublishesthisprotocol;

thelatestisAMF3SpecificationforActionScript3.YoucanfindtableslistingthedatatypemappingswhenconvertingfromActionScripttoJavaandJavatoActionScripthere.

Forcustomorstronglytypedobjects,publicproperties(includingthosedefinedwithgetandsetmethods)areserializedandsentfromtheFlexapplicationtotheserverorfromtheservertotheFlexapplicationaspropertiesofageneral0bject.Toenablemappingbetweenthecorrespondingclientandserver-sideobjects,youusethesamepropertynamesintheJavaandActionScriptclassesandthenintheActionScriptclass,youusethe[RemoteClass]metadatatagtocreateanActionScriptobjectthatmapsdirectlytotheJavaobject.

HereisanexampleEmployeeActionScriptclassthatmapstoaserver-sideEmployeeJavaDTOlocatedintheservicespackageontheserver.

packagevalueobjects.Employee{[Bindable][RemoteClass(alias="

services.Employee"

)]publicclassEmployee{publicvarid:

int;

publicvarfirstName:

String;

publicvarlastName:

(...)}}

InstallingBlazeDSorLiveCycleDataServices

TouseFlashRemotingwithBlazeDSorLiveCycleDataServices,youneedtoinstallandconfigurethenecessaryserver-sidefiles.ForBlazeDS,youcandownloaditasaWARfilewhichyoudeployasawebapplicationorasaturnkeysolution.Theturnkeydownloadcontainsaready-to-useversionofTomcatinwhichthetheBlazeDSWARfilehasalreadybeendeployedandconfiguredalongwithavarietyofsampleapplications.Similarly,forLiveCycleDataServices,theinstallerletsyouchoosetoinstallLiveCyclewithanintegratedTomcatserverorasaLiveCycleDataServiceswebapplication.

Ineitherscenarioawebapplicationcalledblazedsorlcds(usuallyappendedbyaversionnumber)iscreated.YoucanmodifyandbuildoutthisapplicationwithyourJavacode,ormoretypically,youcancopytheJARfilesandconfigurationfilestheblazedsorlcdswebapplicationcontainsandaddthemtoanexistingJavawebapplicationontheserver(seeFigure4).

Figure4.TherequiredBlazeDSorLiveCycleDataServicesfiles.

Modifyingweb.xml

Ifcopyingthefilestoadifferentwebapplication,youalsoneedtomodifytheweb.xmlfiletodefineasessionlistenerforHttpFlexSessionandaservletmappingforMessageBroker,whichhandlesalltherequestsandpassesthemofftothecorrectserver-sideJavaendpoints.Youcancopyandpastethesefromtheoriginalblazedsorlcdswebapplicationweb.xmlfile.

<

!

--HttpFlexSessionattributeandbindinglistenersupport-->

<

listener>

listener-class>

flex.messaging.HttpFlexSession<

/listener-class>

/listener>

--MessageBrokerServlet-->

servlet>

servlet-name>

MessageBrokerServlet<

/servlet-name>

display-name>

/display-name>

servlet-class>

flex.messaging.MessageBrokerServlet<

/servlet-class>

init-param>

param-name>

services.configuration.file<

/param-name>

param-value>

/WEB-INF/flex/services-config.xml<

/param-value>

/init-param>

load-on-startup>

1<

/load-on-startup>

/servlet>

servlet-mapping>

url-pattern>

/messagebroker/*<

/url-pattern>

/servlet-mapping>

Optionally,youmayalsowanttocopyandpaste(anduncomment)themappingforRDSDispatchServlet,which

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 家庭教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1