Post on 25-Apr-2018
HostedbyTikal. www.tikalk.com Cost-BenefitOpenSource
IsraelIsraelJBJBossossUUserserGGrouproupSessionSession0909
FlexFlexRIAvolutionizeyourwebappRIAvolutionizeyourwebapp
IlanAvigdorIlanAvigdor"TikalKnowledge""TikalKnowledge"Ilan@Tikalk.comIlan@Tikalk.com
Hosted by Tikal 2 www.tikalk.com
Israel
JBUG
AgendaAgenda
Introduction Architecture
»Client+Demo
»Communication
»Server Conclusions
Hosted by Tikal 3 www.tikalk.com
Israel
JBUG
RIA ConceptsRIA Concepts
DesktopRich,InternetReach
Applicationvs.Site
Pluginvs.Browser
Runsonclientmachine
Hosted by Tikal 4 www.tikalk.com
Israel
JBUG
FLEX ConceptsFLEX Concepts
Layeronflashfordevelopers
ActionScript3.0
CompiledforAVM2
Hosted by Tikal 5 www.tikalk.com
Israel
JBUG
Advantages - RIAAdvantages - RIA
ForUsers
»Desktop-likeexperience
»Responsiveness
»Cross-browser
»Statefull(nounnecessarypage
reloads)
Hosted by Tikal 6 www.tikalk.com
Israel
JBUG
Advantages - RIAAdvantages - RIA
ForDevelopers
»OOP–Webforthenon-webbers
»Statefull
»Maintenance-Onecodebaseforweb
anddesktop
»Effortlessdeployment
Hosted by Tikal 7 www.tikalk.com
Israel
JBUG
Disadvantages – RIADisadvantages – RIA
Plugindependency
Initialloadandinitialization
Desktop-like
»Memoryleaks
»CPUbottlenecks
Hosted by Tikal 8 www.tikalk.com
Israel
JBUG
Advantages – Adobe FLEXAdvantages – Adobe FLEX
Capabilities
Ubiquity
DeploymentFlexibility
ProvenTechnology
Expressiveness
Openness
Innovation
Hosted by Tikal 9 www.tikalk.com
Israel
JBUG
Disadvantages – Adobe FlexDisadvantages – Adobe Flex
LimitedtoFlashplayerabilities
SWFisproprietary
PopUpwindowslimitedtobrowsersize
MultiThreadingnotsupported
Searchengines–Not
Hosted by Tikal 10 www.tikalk.com
Israel
JBUG
ArchitectureArchitecture
Hosted by Tikal 11 www.tikalk.com
Israel
JBUG
ArchitectureArchitecture
Client
Communicationwithserver
Server
Hosted by Tikal 12 www.tikalk.com
Israel
JBUG
Flex Client FeaturesFlex Client Features
RichComponentLibrary Displaylistprogramming MXML EventModel Effects Styling&skinning Binding Charting(notincluded) Constraintbasedlayout
Hosted by Tikal 13 www.tikalk.com
Israel
JBUG
Flex Client Features Flex Client Features cont.cont.
Drag&Drop Historymanagement Printing Communicationwithwrapper Sharedobject Highlycustomizable Richmediaintegration Modularity
Hosted by Tikal 14 www.tikalk.com
Israel
JBUG
Flex Visual ComponentsFlex Visual Components
General Buttons Date Loaders Menu Text Containers Repeaters
Hosted by Tikal 15 www.tikalk.com
Israel
JBUG
Flex ComponentsFlex Components
Print Validators Formatters Effects States Transitions Datavizualization
» Charts
» DataGrid
» OLAPDataGrid
Hosted by Tikal 16 www.tikalk.com
Israel
JBUG
Display ProgrammingDisplay Programming
Hosted by Tikal 17 www.tikalk.com
Israel
JBUG
MXMLMXML
<mx:Application ><mx:Button id="button" />
/mx:Application>
Equalspublic class Example extends Application
{internal var button:Button;
public function Example() {super();button = new Button();addChild(button);
}
Hosted by Tikal 18 www.tikalk.com
Israel
JBUG
Flex Event ModelFlex Event Model
Hosted by Tikal 19 www.tikalk.com
Israel
JBUG
Flex BindingFlex Binding
<mx:Application> <mx:TextInputid="src"/> <mx:Textid="dest" text="{src.text.toUpperCase()}"/></mx:Application>
Hosted by Tikal 20 www.tikalk.com
Israel
JBUG ArchitectureArchitecture
Client – MVC ArchitectureClient – MVC Architecture
Hosted by Tikal 21 www.tikalk.com
Israel
JBUG
Why?
»Out-Of-The-BoxMVCframework
»Crossprojects
»Betterscalability
Which?
»Cairngorm
»PureMVC
ArchitectureFlex Frameworks
Hosted by Tikal 22 www.tikalk.com
Israel
JBUG
DEMO
Hosted by Tikal 23 www.tikalk.com
Israel
JBUG
Protocols
CommunicationPatterns
»RPC
»DataPush
ArchitectureCommunication With Server
Hosted by Tikal 24 www.tikalk.com
Israel
JBUG
HTTP
SOAP
XML
Binary(POP3,SMTP,IMAP,andNNTP)
RTMP
JSON
AMF3
Communication With ServerProtocols
Hosted by Tikal 25 www.tikalk.com
Israel
JBUG
Hosted by Tikal 15 www.tikalk.com
Communication with ServerCommunication with ServerProtocols benchmarkProtocols benchmark
Hosted by Tikal 26 www.tikalk.com
Israel
JBUG
Fluorine-.Net
Red5–java
Cinnamon–java
SabreAMF–PHP5
Rubyamf–Rails
PyAMF-Python
Communication With ServerAMF3 ImplementationsAMF3 Implementations
Hosted by Tikal 27 www.tikalk.com
Israel
JBUG
RequestResponse
»HTTP
»WebServices
»Remoting
DataPush
»Sockets-Bidirectionalconnection
»Messaging-Pub/Sub
Communication With ServerCommunication PatternsCommunication Patterns
Hosted by Tikal 28 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
HTTPHTTP
<mx:HTTPService url="http://localhost/req.php"method="POST">
<mx:request> <username>UserName</username><address>Address</address>
</mx:request></mx:HTTPService>
Hosted by Tikal 29 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
Web ServiceWeb Service
<mx:WebService id="userReq" wsdl=”http://Localhost/users.cfc?wsdl">
<mx:operation name="returnRecords" result="returnRecordsHandler()" />
<mx:operation name="insertRec"result="insertCFCHandler()" />
</mx:WebService>
private function clickHandler():void { userReq.insertRec(n.text,address.text); }
Hosted by Tikal 30 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
RemotingRemoting
<mx:RemoteObject id="userReq"destination="ColdFusion"source="flexapp.returnusers">
<mx:method name="insertRecord"result="insertHandler()"/>
</mx:RemoteObject>
private function Onclick():void{userReq.insertRecord( name.text,
address.text); }
Hosted by Tikal 31 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
SocketsSockets<mx:Application >
private function Onconnect(event:Event):void{
trace("Connected");}
private function Ondata(event:DataEvent){trace ("data arrived" + event.data);}
<net:XMLSocket id="sock"connect="Onconnect()" data="OnData()"/>
<mx:Buttonclick="{sock.connect('localhost',4444)}"/>
</mx:Application>
Hosted by Tikal 32 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
Messaging RegistrationMessaging Registration<mx:Producer id="chat"
destination="MyTransientTopic" /> <mx:Consumer id="chatSubscriber"
destination="MyTransientTopic"
message="receive(event)" />
Hosted by Tikal 33 www.tikalk.com
Israel
JBUG Communication with ServerCommunication with Server
Messaging Send/ReceiveMessaging Send/Receiveprivate function sendChatMessage():void {
msg = new AsyncMessage();
msg.body = input.text;
chat.send(msg);
}
receive(event:MessageEvent):void{
var msg:AsyncMessage = event.message as AsyncMessage; output.text += msg.body ;
}
Hosted by Tikal 34 www.tikalk.com
Israel
JBUG
LiveCycleES–J2EE
LiveCycleDS–J2EE
BlazeDS(opensource)–J2EE
Granite(opensource)–J2EE
WebOrb(opensource)
».NET,J2EE,ROR,PHP
ArchitectureArchitectureServer side PlatformsServer side Platforms
Hosted by Tikal 35 www.tikalk.com
Israel
JBUG Server side PlatformsServer side Platforms
LiveCycle ESLiveCycle ES
Hosted by Tikal 36 www.tikalk.com
Israel
JBUG Server side PlatformsServer side Platforms
LiveCycle DS vs. BlazeDSLiveCycle DS vs. BlazeDS
LiveCycle DS ExpressLiveCycle DS Express LiveCycle DS CommunityLiveCycle DS Community
Hosted by Tikal 37 www.tikalk.com
Israel
JBUG
.Net»Remoting,DataManagementMessaging,RTMP,AMF
Java»Remoting,DataManagementMessaging
Rubi»Remoting
PHP»Remoting
Server side PlatformsServer side PlatformsWebOrbWebOrb
Hosted by Tikal 38 www.tikalk.com
Israel
JBUG
Stable(Productionready)»AMF3»Ejb3services(sessionbeans)»Ejb3persistence(Hibernate)withlazy-loadingsupport»SpringserviceswithAcegisecurity»Pojoservices
Experimental(beta)»Datapush(Gravity)»Seamservices»Guice/Warpservices
Server side PlatformsServer side PlatformsGraniteGranite
Hosted by Tikal 39 www.tikalk.com
Israel
JBUG
QA?
Hosted by Tikal 40 www.tikalk.com
Israel
JBUG
Appendix
Hosted by Tikal 41 www.tikalk.com
Israel
JBUG Architecture
Client – Cairngorm Architecture
Hosted by Tikal 42 www.tikalk.com
Israel
JBUG Architecture
Client – PureMVC Architecture
Hosted by Tikal 43 www.tikalk.com
Israel
JBUG
DevelopedandusedbyAdobeConsulting
Pros
»defacto-standardformostorganizations
»Easytolearn
Flex frameworksCairngorm
Hosted by Tikal 44 www.tikalk.com
Israel
JBUG
ConsCons
»Extensiveuseofsingletons
»Doesnotofferanelegantwayforits
controllertocommunicatebacktoits
views(workaroundexists)
»Problematicwhenusingmodules.
Flex frameworksCairngorm
Hosted by Tikal 45 www.tikalk.com
Israel
JBUG
NoFlexdependencyorawareness Pros»CleanerseparationofviewandVos»Considered"better"
Cons»NoServiceLocator-liketool»NoModel-ViewDataBinding»Requiresmorework»Morecomplex
Flex frameworksPureMVC