SlideShare a Scribd company logo
Spring ActionScript byChristopheHerreman Flex Consultant at Boulevart
Overall presentation Introduction to Spring ActionScript: whatit does and howyou benefit fromusingit
Agenda What is Spring ActionScript The IoC container Configuration MVC Architecture Demo Q&A
Speaker’squalifications CertifiedAdobeFlex & AIR expert 10 yearsplayingwith Flash technology Founder and leaddeveloper of AS3Commons & Spring ActionScript Tech reviewerforFoED/Apress
What is Spring ActionScript(1/2) Inversion of Control (IoC) forActionScript 3.0 Flash/Flex/AIR/Pure AS3 IoC container MVC?
What is Spring ActionScript(2/2) Started as anin-houselibrary Formerlyknown as the Pranaframework Incubated as a Spring Extension project Upcoming release 0.9 AS3Commons: Lang, Logging, Reflect, …
The IoC Container (1/3) = Object Factory Creates and assembles objects Centralizeddependency management Spring AS: configuration via XML or MXML
The IoC Container (2/3) Object (bean): object managed and/orcreatedby the container Object Factory: factorythatcreates and managesobjects factory.getObject(“myObject”) Object Definition: blueprintforan object Application Context: smarter Object Factory
The IoC Container (3/3) Object Scopes Singleton: onlyoneinstance in the container Notlinked to the Singleton Design Pattern The default scope factory.getObject(“obj”) == factory.getObject(“obj”) Prototype: newinstancecreatedoneachrequest factory.getObject(“obj”) != factory.getObject(“obj”)
Configuration(1/9) MXML Configuration // AppContext.mxml file, compiledinto the application <Objects> 	<app:ApplicationModelid=“appModel” /> 	<app:ApplicationControllerid=“appController” 		applicationModel=“{appModel}”/> </Objects>
Configuration(2/9) MXML Configuration: loading varcontext:MXMLApplicationContext = newMXMLApplicationContext(); context.addConfig(AppContext); context.addEventListener(Event.COMPLETE, context_completeHandler); context.load(); function context_completeHandler(event:Event):void { varappModel:ApplicationModel = context.getObject(“appModel”); varappController:ApplicationController = 					  		context.getObject(“appController”); }
Configuration(3/9) MXML Configuration: alternativeapproach // AppContext.mxml file, compiledinto the application <Objects> 	<Object id=“appModel” clazz=“{ApplicationModel}”/> 	<Object id=“appController” clazz=“{ApplicationController}”> 			<Property name=“applicationModel” ref=“appModel”/> 	</Object> </objects>
Configuration(4/9) MXML Configuration: pros Editor support Simple to use
Configuration(5/9) MXML Configuration: cons Compiledinto the application Explicitdeclaration: limited to singletons, noexternalreferences, no prototypes -> use Spring AS MXML dialect
Configuration(6/9) XML Configuration // externalcontext.xml, loadedonapplicationstartup <objects> 	<object id=“appModel” class=“com.domain.app.ApplicationModel”/> 	<object id=“appController” class=“com.domain.app.ApplicationController”> 			<property name=“applicationModel” ref=“appModel”/> 	</object> </objects>
Configuration(7/9) XML Configuration: loading varcontext:XMLApplicationContext = newXMLApplicationContext(); context.addConfigLocation(“context.xml”); context.addEventListener(Event.COMPLETE, context_completeHandler); context.load(); function context_completeHandler(event:Event):void { 	var appModel:ApplicationModel = context.getObject(“appModel”); 	var appController:ApplicationController = 					  		context.getObject(“appController”); }
Configuration(8/9) XML Configuration: pros Richer dialect than MXML config Usablefornon-Flexprojects No need to recompile (in some cases) Familiar to Spring Java users
Configuration(9/9) XML Configuration: cons Classes need to becompiledinto the app, noclassloading (!) No editor support, only XSD
MVC Architecture(1/2) No realprescriptivearchitecture Do youreallyneedone? Rollyourownbecauseone does NOT fit all Many MVC architectures out there: Cairngorm, PureMVC, Mate, … … Spring AS wants to support them
MVC Architecture(2/2) Spring AS MVC ingredients Operation API  Event Bus Autowiring Recommendations Presentation Model (Fowler) LayeredArchitecture (DDD – Evans)
The Operation API (1/7) Asynchronousbehavior in Flash Player: loadingexternal resources, RMI, sqlite, Webservices, HTTPServices, … No threading API Many different APIs: AsyncToken, Responders, Callbacks, Events… we need a unifiedapproach!
The Operation API (2/7) Problem: a user repository (or service) interface IUserRepository { functiongetUser(id:int): ??? } What does the getUsermethod return? AsyncToken (Flex/RemoteObject), User (In memory), void (events)
The Operation API (3/7) Spring AS solution: return a IOperation interface IUserRepository { functiongetUser(id:int):IOperation; } Cannowbeused in anyActionScript 3 context and easilymockedfortesting
The Operation API (4/7) In Spring AS, an “operation” is used to indicateanasynchronousexecution IOperation interface with “complete” and “error” events IProgressOperationwith “progress” event OperationQueuebundlesoperations (a compositeoperation)
The Operation API (5/7) Defininganoperation: publicclassGetUserOperationextendsAbstractOperation { functionGetUserOperation(remoteObject:RemoteObject, id:String) { vartoken:AsyncToken = remoteObject.getUser(id); token.addResponder(newResponder(resultHandler, faultHandler)); 	} 	private functionresultHandler(event:ResultEvent):void { dispatchCompleteEvent(User(event.result)); 	} 	private functionfaultHandler(event:FaultEvent):void { dispatchErrorEvent(event.fault); 	} }
The Operation API (6/7) Usage: varoperation:IOperation = newGetUserOperation(remoteObject, 13); operation.addCompleteListener(function(event:OperationEvent):void { varuser:User = event.result; }); operation.addErrorListener(function(event:OperationEvent):void { Alert.show(event.error, “Error”); });
The Operation API (7/7) A progressoperation: varoperation:IOperation = newSomeProgressOperation(param1, param2); operation.addCompleteListener(function(event:OperationEvent):void { }); operation.addErrorListener(function(event:OperationEvent):void { }); operation.addProgressListener(function(event:OperationEvent):void { 	var op:IProgressOperation = IProgressOperation(event.operation); trace(“Progress:” + op.progress + “, total: “ + op.total); });
The Event Bus (1/3) Publish/subscribeevent system Usedforglobalapplicationevents Promotesloosecoupling Works withstandard Flash Events
The Event Bus (2/3) Listening/subscribing to events: // listen for all events EventBus.addListener(listener:IEventBusListener); functiononEvent(event:Event):void { } // listen forspecificevents EventBus.addEventListener(“anEvent”, handler); functionhandler(event:Event):void { }
The Event Bus (3/3) Dispatching/publishingevents: // dispatchstandardevent EventBus.dispatchEvent(newEvent(“someEvent”)); // dispatchcustomevent classUserEventextendsEvent { 	...  } EventBus.dispatchEvent(newUserEvent(UserEvent.DELETE, user));
Autowiring(1/2) Auto DependencyInjection via metadata Autowireby type, name, constructor, autodetect Works forobjectsmanagedby the container and for view components Be careful: magic happens, noexplicitconfiguration
Autowiring(2/2) Annotate a propertywith [Autowired] classUserController { 	[Autowired] 	public var userRepository:IUserRepository; } [Autowired(name=“myObject“, property=“prop”)]
Summary Dependency Management Loosecoupling, type to interfaces Usewithotherframeworks Spring mentality: provide choice Promote best practices
DEMO A sample application
Thanksforyourattention! www.herrodius.com info@herrodius.com www.springactionscript.org www.as3commons.org

More Related Content

What's hot

Spring mvc
Spring mvcSpring mvc
Spring mvc
Hamid Ghorbani
 
Introduction to OWIN
Introduction to OWINIntroduction to OWIN
Introduction to OWIN
Saran Doraiswamy
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
David Kiss
 
25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications
Anghel Leonard
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
John Lewis
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3gvasya10
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
yuvalb
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Aaron Schram
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
Bilal Haidar
 
Architecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCArchitecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVC
marcocasario
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
Hùng Nguyễn Huy
 
Titanium - Making the most of your single thread
Titanium - Making the most of your single threadTitanium - Making the most of your single thread
Titanium - Making the most of your single thread
Ronald Treur
 
Spring aop
Spring aopSpring aop
Spring aop
Hamid Ghorbani
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
John Lewis
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
Hendrik Ebbers
 

What's hot (20)

Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Introduction to OWIN
Introduction to OWINIntroduction to OWIN
Introduction to OWIN
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
 
25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications25+ Reasons to use OmniFaces in JSF applications
25+ Reasons to use OmniFaces in JSF applications
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3g
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
 
Architecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCArchitecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVC
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Titanium - Making the most of your single thread
Titanium - Making the most of your single threadTitanium - Making the most of your single thread
Titanium - Making the most of your single thread
 
Spring aop
Spring aopSpring aop
Spring aop
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 

Viewers also liked

Spring ActionScript
Spring ActionScriptSpring ActionScript
Spring ActionScript
Christophe Herreman
 
Actionscript
ActionscriptActionscript
Actionscript
saad_darwish
 
Quick Step by Step Flash Tutorial
Quick Step by Step Flash TutorialQuick Step by Step Flash Tutorial
Quick Step by Step Flash Tutorial
Su Yuen Chin
 
What is an Effective Layout?
What is an Effective Layout?What is an Effective Layout?
What is an Effective Layout?
Kern Learning Solution
 
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
Pablo Farías Navarro
 
Mobile Game Development using Adobe Flash
Mobile Game Development using Adobe FlashMobile Game Development using Adobe Flash
Mobile Game Development using Adobe Flashchall3ng3r
 
TCH Technology Consulting Group forging success with Account Payable Recovery
TCH Technology Consulting Group forging success with Account Payable RecoveryTCH Technology Consulting Group forging success with Account Payable Recovery
TCH Technology Consulting Group forging success with Account Payable Recovery
TCH Technology Consulting Group / TCH International Group
 
Learn ActionScript programming myassignmenthelp.net
Learn ActionScript programming myassignmenthelp.netLearn ActionScript programming myassignmenthelp.net
Learn ActionScript programming myassignmenthelp.net
www.myassignmenthelp.net
 
Account payable manager
Account payable managerAccount payable manager
Account payable manager
hughjackman261
 
Account receivable manager
Account receivable managerAccount receivable manager
Account receivable manager
hughjackman261
 
Lessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projectsLessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projects
Zeh Fernando
 
Top 8 account payable clerk resume samples
Top 8 account payable clerk resume samplesTop 8 account payable clerk resume samples
Top 8 account payable clerk resume samples
martinwilson397
 
Account receivable clerk kpi
Account receivable clerk kpiAccount receivable clerk kpi
Account receivable clerk kpigkatgutos
 
Can secwest2011 flash_actionscript
Can secwest2011 flash_actionscriptCan secwest2011 flash_actionscript
Can secwest2011 flash_actionscript
Craft Symbol
 
Account Recievable and Account Payable
Account Recievable and Account PayableAccount Recievable and Account Payable
Account Recievable and Account Payable
Habeeb Rahman
 
Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0Peter Elst
 
Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!
Arul Kumaran
 
Account payable
Account payableAccount payable
Account payable
Winda Rizkyfa
 
Actionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEActionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDE
OUM SAOKOSAL
 

Viewers also liked (20)

Spring ActionScript
Spring ActionScriptSpring ActionScript
Spring ActionScript
 
Actionscript
ActionscriptActionscript
Actionscript
 
Quick Step by Step Flash Tutorial
Quick Step by Step Flash TutorialQuick Step by Step Flash Tutorial
Quick Step by Step Flash Tutorial
 
What is an Effective Layout?
What is an Effective Layout?What is an Effective Layout?
What is an Effective Layout?
 
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
HTML5 Mobile Game Development Workshop - Module 1 - HTML5 Developer Conferenc...
 
Mobile Game Development using Adobe Flash
Mobile Game Development using Adobe FlashMobile Game Development using Adobe Flash
Mobile Game Development using Adobe Flash
 
TCH Technology Consulting Group forging success with Account Payable Recovery
TCH Technology Consulting Group forging success with Account Payable RecoveryTCH Technology Consulting Group forging success with Account Payable Recovery
TCH Technology Consulting Group forging success with Account Payable Recovery
 
Learn ActionScript programming myassignmenthelp.net
Learn ActionScript programming myassignmenthelp.netLearn ActionScript programming myassignmenthelp.net
Learn ActionScript programming myassignmenthelp.net
 
Account payable manager
Account payable managerAccount payable manager
Account payable manager
 
Account receivable manager
Account receivable managerAccount receivable manager
Account receivable manager
 
Lessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projectsLessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projects
 
Top 8 account payable clerk resume samples
Top 8 account payable clerk resume samplesTop 8 account payable clerk resume samples
Top 8 account payable clerk resume samples
 
Account receivable clerk kpi
Account receivable clerk kpiAccount receivable clerk kpi
Account receivable clerk kpi
 
Can secwest2011 flash_actionscript
Can secwest2011 flash_actionscriptCan secwest2011 flash_actionscript
Can secwest2011 flash_actionscript
 
Account Recievable and Account Payable
Account Recievable and Account PayableAccount Recievable and Account Payable
Account Recievable and Account Payable
 
Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0Creative Programming in ActionScript 3.0
Creative Programming in ActionScript 3.0
 
SAP FICO Collection
SAP FICO CollectionSAP FICO Collection
SAP FICO Collection
 
Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!
 
Account payable
Account payableAccount payable
Account payable
 
Actionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEActionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDE
 

Similar to Spring Actionscript at Devoxx

Christophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java ExchangeChristophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java ExchangeSkills Matter
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
John Lewis
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Codemotion
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
Srikanth Shenoy
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
Peter Gfader
 
Spring Boot: a Quick Introduction
Spring Boot: a Quick IntroductionSpring Boot: a Quick Introduction
Spring Boot: a Quick Introduction
Roberto Casadei
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
Singapore PHP User Group
 
Eclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugEclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ Rheinjug
Lars Vogel
 
Eclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three RuntimesEclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three Runtimes
Suresh Krishna Madhuvarsu
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Svetlin Nakov
 
Developing Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring toolsDeveloping Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring tools
Sathish Chittibabu
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
Right IT Services
 
Spring framework
Spring frameworkSpring framework
Spring frameworksrmelody
 
FraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of MiddlewareFraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of Middleware
philippe_merle
 
Introduction To Adobe Flex And Semantic Resources
Introduction To Adobe Flex And Semantic ResourcesIntroduction To Adobe Flex And Semantic Resources
Introduction To Adobe Flex And Semantic Resources
keith_sutton100
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
Muthuselvam RS
 
Eclipse RCP
Eclipse RCPEclipse RCP
Eclipse RCP
Vijay Kiran
 
javagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platformjavagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platform
Tonny Madsen
 

Similar to Spring Actionscript at Devoxx (20)

Christophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java ExchangeChristophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java Exchange
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 
Spring Boot: a Quick Introduction
Spring Boot: a Quick IntroductionSpring Boot: a Quick Introduction
Spring Boot: a Quick Introduction
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
Eclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugEclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ Rheinjug
 
Eclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three RuntimesEclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three Runtimes
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Developing Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring toolsDeveloping Agile Java Applications using Spring tools
Developing Agile Java Applications using Spring tools
 
Rits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce LightningRits Brown Bag - Salesforce Lightning
Rits Brown Bag - Salesforce Lightning
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
FraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of MiddlewareFraSCAti Adaptive and Reflective Middleware of Middleware
FraSCAti Adaptive and Reflective Middleware of Middleware
 
Introduction To Adobe Flex And Semantic Resources
Introduction To Adobe Flex And Semantic ResourcesIntroduction To Adobe Flex And Semantic Resources
Introduction To Adobe Flex And Semantic Resources
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Eclipse RCP
Eclipse RCPEclipse RCP
Eclipse RCP
 
javagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platformjavagruppen.dk - e4, the next generation Eclipse platform
javagruppen.dk - e4, the next generation Eclipse platform
 

More from Christophe Herreman

De kathedraal en de bazaar
De kathedraal en de bazaarDe kathedraal en de bazaar
De kathedraal en de bazaar
Christophe Herreman
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action scriptChristophe Herreman
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptChristophe Herreman
 
GradleFX
GradleFXGradleFX
AS3Commons Introduction
AS3Commons IntroductionAS3Commons Introduction
AS3Commons Introduction
Christophe Herreman
 
The Prana IoC Container
The Prana IoC ContainerThe Prana IoC Container
The Prana IoC Container
Christophe Herreman
 

More from Christophe Herreman (6)

De kathedraal en de bazaar
De kathedraal en de bazaarDe kathedraal en de bazaar
De kathedraal en de bazaar
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action script
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
 
GradleFX
GradleFXGradleFX
GradleFX
 
AS3Commons Introduction
AS3Commons IntroductionAS3Commons Introduction
AS3Commons Introduction
 
The Prana IoC Container
The Prana IoC ContainerThe Prana IoC Container
The Prana IoC Container
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Spring Actionscript at Devoxx

  • 1. Spring ActionScript byChristopheHerreman Flex Consultant at Boulevart
  • 2. Overall presentation Introduction to Spring ActionScript: whatit does and howyou benefit fromusingit
  • 3. Agenda What is Spring ActionScript The IoC container Configuration MVC Architecture Demo Q&A
  • 4. Speaker’squalifications CertifiedAdobeFlex & AIR expert 10 yearsplayingwith Flash technology Founder and leaddeveloper of AS3Commons & Spring ActionScript Tech reviewerforFoED/Apress
  • 5. What is Spring ActionScript(1/2) Inversion of Control (IoC) forActionScript 3.0 Flash/Flex/AIR/Pure AS3 IoC container MVC?
  • 6. What is Spring ActionScript(2/2) Started as anin-houselibrary Formerlyknown as the Pranaframework Incubated as a Spring Extension project Upcoming release 0.9 AS3Commons: Lang, Logging, Reflect, …
  • 7. The IoC Container (1/3) = Object Factory Creates and assembles objects Centralizeddependency management Spring AS: configuration via XML or MXML
  • 8. The IoC Container (2/3) Object (bean): object managed and/orcreatedby the container Object Factory: factorythatcreates and managesobjects factory.getObject(“myObject”) Object Definition: blueprintforan object Application Context: smarter Object Factory
  • 9. The IoC Container (3/3) Object Scopes Singleton: onlyoneinstance in the container Notlinked to the Singleton Design Pattern The default scope factory.getObject(“obj”) == factory.getObject(“obj”) Prototype: newinstancecreatedoneachrequest factory.getObject(“obj”) != factory.getObject(“obj”)
  • 10. Configuration(1/9) MXML Configuration // AppContext.mxml file, compiledinto the application <Objects> <app:ApplicationModelid=“appModel” /> <app:ApplicationControllerid=“appController” applicationModel=“{appModel}”/> </Objects>
  • 11. Configuration(2/9) MXML Configuration: loading varcontext:MXMLApplicationContext = newMXMLApplicationContext(); context.addConfig(AppContext); context.addEventListener(Event.COMPLETE, context_completeHandler); context.load(); function context_completeHandler(event:Event):void { varappModel:ApplicationModel = context.getObject(“appModel”); varappController:ApplicationController = context.getObject(“appController”); }
  • 12. Configuration(3/9) MXML Configuration: alternativeapproach // AppContext.mxml file, compiledinto the application <Objects> <Object id=“appModel” clazz=“{ApplicationModel}”/> <Object id=“appController” clazz=“{ApplicationController}”> <Property name=“applicationModel” ref=“appModel”/> </Object> </objects>
  • 13. Configuration(4/9) MXML Configuration: pros Editor support Simple to use
  • 14. Configuration(5/9) MXML Configuration: cons Compiledinto the application Explicitdeclaration: limited to singletons, noexternalreferences, no prototypes -> use Spring AS MXML dialect
  • 15. Configuration(6/9) XML Configuration // externalcontext.xml, loadedonapplicationstartup <objects> <object id=“appModel” class=“com.domain.app.ApplicationModel”/> <object id=“appController” class=“com.domain.app.ApplicationController”> <property name=“applicationModel” ref=“appModel”/> </object> </objects>
  • 16. Configuration(7/9) XML Configuration: loading varcontext:XMLApplicationContext = newXMLApplicationContext(); context.addConfigLocation(“context.xml”); context.addEventListener(Event.COMPLETE, context_completeHandler); context.load(); function context_completeHandler(event:Event):void { var appModel:ApplicationModel = context.getObject(“appModel”); var appController:ApplicationController = context.getObject(“appController”); }
  • 17. Configuration(8/9) XML Configuration: pros Richer dialect than MXML config Usablefornon-Flexprojects No need to recompile (in some cases) Familiar to Spring Java users
  • 18. Configuration(9/9) XML Configuration: cons Classes need to becompiledinto the app, noclassloading (!) No editor support, only XSD
  • 19. MVC Architecture(1/2) No realprescriptivearchitecture Do youreallyneedone? Rollyourownbecauseone does NOT fit all Many MVC architectures out there: Cairngorm, PureMVC, Mate, … … Spring AS wants to support them
  • 20. MVC Architecture(2/2) Spring AS MVC ingredients Operation API Event Bus Autowiring Recommendations Presentation Model (Fowler) LayeredArchitecture (DDD – Evans)
  • 21. The Operation API (1/7) Asynchronousbehavior in Flash Player: loadingexternal resources, RMI, sqlite, Webservices, HTTPServices, … No threading API Many different APIs: AsyncToken, Responders, Callbacks, Events… we need a unifiedapproach!
  • 22. The Operation API (2/7) Problem: a user repository (or service) interface IUserRepository { functiongetUser(id:int): ??? } What does the getUsermethod return? AsyncToken (Flex/RemoteObject), User (In memory), void (events)
  • 23. The Operation API (3/7) Spring AS solution: return a IOperation interface IUserRepository { functiongetUser(id:int):IOperation; } Cannowbeused in anyActionScript 3 context and easilymockedfortesting
  • 24. The Operation API (4/7) In Spring AS, an “operation” is used to indicateanasynchronousexecution IOperation interface with “complete” and “error” events IProgressOperationwith “progress” event OperationQueuebundlesoperations (a compositeoperation)
  • 25. The Operation API (5/7) Defininganoperation: publicclassGetUserOperationextendsAbstractOperation { functionGetUserOperation(remoteObject:RemoteObject, id:String) { vartoken:AsyncToken = remoteObject.getUser(id); token.addResponder(newResponder(resultHandler, faultHandler)); } private functionresultHandler(event:ResultEvent):void { dispatchCompleteEvent(User(event.result)); } private functionfaultHandler(event:FaultEvent):void { dispatchErrorEvent(event.fault); } }
  • 26. The Operation API (6/7) Usage: varoperation:IOperation = newGetUserOperation(remoteObject, 13); operation.addCompleteListener(function(event:OperationEvent):void { varuser:User = event.result; }); operation.addErrorListener(function(event:OperationEvent):void { Alert.show(event.error, “Error”); });
  • 27. The Operation API (7/7) A progressoperation: varoperation:IOperation = newSomeProgressOperation(param1, param2); operation.addCompleteListener(function(event:OperationEvent):void { }); operation.addErrorListener(function(event:OperationEvent):void { }); operation.addProgressListener(function(event:OperationEvent):void { var op:IProgressOperation = IProgressOperation(event.operation); trace(“Progress:” + op.progress + “, total: “ + op.total); });
  • 28. The Event Bus (1/3) Publish/subscribeevent system Usedforglobalapplicationevents Promotesloosecoupling Works withstandard Flash Events
  • 29. The Event Bus (2/3) Listening/subscribing to events: // listen for all events EventBus.addListener(listener:IEventBusListener); functiononEvent(event:Event):void { } // listen forspecificevents EventBus.addEventListener(“anEvent”, handler); functionhandler(event:Event):void { }
  • 30. The Event Bus (3/3) Dispatching/publishingevents: // dispatchstandardevent EventBus.dispatchEvent(newEvent(“someEvent”)); // dispatchcustomevent classUserEventextendsEvent { ... } EventBus.dispatchEvent(newUserEvent(UserEvent.DELETE, user));
  • 31. Autowiring(1/2) Auto DependencyInjection via metadata Autowireby type, name, constructor, autodetect Works forobjectsmanagedby the container and for view components Be careful: magic happens, noexplicitconfiguration
  • 32. Autowiring(2/2) Annotate a propertywith [Autowired] classUserController { [Autowired] public var userRepository:IUserRepository; } [Autowired(name=“myObject“, property=“prop”)]
  • 33. Summary Dependency Management Loosecoupling, type to interfaces Usewithotherframeworks Spring mentality: provide choice Promote best practices
  • 34. DEMO A sample application
  • 35. Thanksforyourattention! www.herrodius.com info@herrodius.com www.springactionscript.org www.as3commons.org