SlideShare a Scribd company logo
1 of 21
Extensions & Utilities
Who am I
Yennick Trevels
Rich Application Consultant @ iDA MediaFoundry
Adobe Flex 4 Certified Expert
Robotlegs
3rd generation MVC(S) Micro architecture
Lightweight
Dependency Injection
Signals extension
Use signals to trigger commands
Automatic injection of signal parameters
into the commands
AS3-Signals: example
var contactsLoaded:Signal = new Signal(ArrayCollection);
contactsLoaded.add(contactsLoadedHandler);
contactsLoaded.dispatch(contacts);
private function contactsLoadedHandler(contacts:ArrayCollection):void
{
// handler code
}
Signals extension: Usage
Context
public class MyContext extends SignalContext {
override public function startup():void {
… //other injection mappings
injector.mapSingleton(SaveContactSignal);
signalCommandMap.mapSignalClass(
SaveContactSignal, SaveContactCommand);
}
}
Signals extension: Usage
Mediator
public class ContactFormMediator extends Mediator{
[Inject]
public var saveContact:SaveContactSignal;
...
private function saveButton_click(event:MouseEvent):void {
saveContact.dispatch(contact);
}
}
Signals extension: Usage
Command
public class SaveContactCommand extends SignalCommand {
[Inject]
public var contact:Contact;
...
override public function execute():void {
contactService.saveContact(contact);
}
 }
ModuleContext
Modular extension
Without the extension:
 One Context per module
 Each module works independently
 No communication between modules
Facilitates communication between modules
Shell
IModuleEventDispatcher
ModuleContext
Module
ModuleContext
Module
Modular extension: Usage
Module Context
public class MyModuleContext extends ModuleContext { ... }
Module general Mediator
public class MyModuleMediator extends ModuleMediator {
...
private function exitModuleHandler():void {
var exitModuleEvent:ModuleEvent = new
ModuleEvent(ModuleEvent.EXIT_MODULE);
dispatchToModules(exitModuleEvent);
}
}
Modular extension: Usage
Shell/Module Mediator
public class ShellMediator extends ModuleMediator {
override public function onRegister():void {
eventMap.mapListener(moduleDispatcher,
ModuleEvent.EXIT_MODULE, moduleExitHandler,
ModuleEvent);
}
...
}
Signals & Modular
extension?
Not possible by default
Solution
1. Take the SignalContext code and copy it into a new
ModuleSignalContext class
2. Take the ModularContext code and merge it into the new
class
3. Done & works like a charm
OptionCommandMap utility
Run different command based on selected option
Use case:
1. User has the choice between several options
2. Based on the chosen option a different command will
run
Automatic removal of mappings after one option
has been processed
Removes the need for an custom event per option
OptionCommandMap utility
Streamlines the following:
Setup
commandMap.mapEvent(SelectCharacterEvent.MAGE,
SelectMageCommand, SelectCharacterEvent);
commandMap.mapEvent(SelectCharacterEvent.WARRIOR,
SelectWarriorCommand, SelectCharacterEvent);
Once a command has been processed
commandMap.unmapEvent(SelectCharacterEvent.MAGE,
SelectMageCommand, SelectCharacterEvent);
commandMap.unmapEvent(SelectCharacterEvent.WARRIOR,
SelectWarriorCommand, SelectCharacterEvent);
OptionCommandMap:
Usage
Context
override protected function mapInjections():void {
super.mapInjections();
injector.mapValue(IOptionCommandMap, new
OptionCommandMap(eventDispatcher, injector, reflector));
}
Inside Mediator or Command
//map the options
optionCommandMap.mapOption(1, SelectMageCommand);
optionCommandMap.mapOption(2, SelectWarriorCommand);
OptionCommandMap:
Usage
Trigger an option
var event:OptionEvent = new OptionEvent(OptionEvent[“OPTION_1”]);
dispatch(event);
Macrobot utility
execute commands in:
Sequence: SequenceCommand
Parallel: ParallelCommand
Macrobot: Usage
Parallel
var command:ParallelCommand = new ParallelCommand();
command.addCommand(FirstCommand);
command.addCommand(SecondCommand);
Command.addCompletionListener(command_completeHandler);
command.execute();
private function command_completeHandler(success:boolean):void
{
//perform completion code here
}
Macrobot: Usage
Sequence
var command:SequenceCommand = new SequenceCommand();
command.addCommand(FirstCommand);
command.addCommand(SecondCommand);
Command.addCompletionListener(command_completeHandler);
command.execute();
private function command_completeHandler(success:boolean):void
{
//perform completion code here
}
Resources
Robotlegs
http://www.robotlegs.org/
Signals extension
https://github.com/joelhooks/signals-extensions-CommandSignal
Modular extension
https://github.com/joelhooks/robotlegs-utilities-Modular
OptionCommandMap utility
https://github.com/Stray/robotlegs-utilities-OptionCommandMap
Macrobot utility
https://github.com/Aaronius/robotlegs-utilities-Macrobot

More Related Content

Viewers also liked

Luxury beauty brands - Sustainability is good for business
Luxury beauty brands - Sustainability is good for businessLuxury beauty brands - Sustainability is good for business
Luxury beauty brands - Sustainability is good for business
Edwige Riou
 
Luxury beauty brands - Getting communication right between global teams
Luxury beauty brands - Getting communication right between global teamsLuxury beauty brands - Getting communication right between global teams
Luxury beauty brands - Getting communication right between global teams
Edwige Riou
 
MY INTERN EXPERIENCE @ CPL
MY INTERN EXPERIENCE @ CPLMY INTERN EXPERIENCE @ CPL
MY INTERN EXPERIENCE @ CPL
altheaibba
 
Live the khas lifestyle
Live the khas lifestyleLive the khas lifestyle
Live the khas lifestyle
Nayyer Razaq
 
Luxury beauty brands - POS Production Models
Luxury beauty brands - POS Production ModelsLuxury beauty brands - POS Production Models
Luxury beauty brands - POS Production Models
Edwige Riou
 

Viewers also liked (14)

Ivan Shaban - Robotlegs 2+
Ivan Shaban - Robotlegs 2+Ivan Shaban - Robotlegs 2+
Ivan Shaban - Robotlegs 2+
 
Luxury beauty brands - Sustainability is good for business
Luxury beauty brands - Sustainability is good for businessLuxury beauty brands - Sustainability is good for business
Luxury beauty brands - Sustainability is good for business
 
Economics
EconomicsEconomics
Economics
 
Ethics
EthicsEthics
Ethics
 
Luxury beauty brands - Getting communication right between global teams
Luxury beauty brands - Getting communication right between global teamsLuxury beauty brands - Getting communication right between global teams
Luxury beauty brands - Getting communication right between global teams
 
MY INTERN EXPERIENCE @ CPL
MY INTERN EXPERIENCE @ CPLMY INTERN EXPERIENCE @ CPL
MY INTERN EXPERIENCE @ CPL
 
equal employment
equal employment equal employment
equal employment
 
Analisis konteks
Analisis konteksAnalisis konteks
Analisis konteks
 
Live the khas lifestyle
Live the khas lifestyleLive the khas lifestyle
Live the khas lifestyle
 
Durda presentation
Durda presentationDurda presentation
Durda presentation
 
Slick - The Structured Way
Slick - The Structured WaySlick - The Structured Way
Slick - The Structured Way
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
React server side rendering performance
React server side rendering performanceReact server side rendering performance
React server side rendering performance
 
Luxury beauty brands - POS Production Models
Luxury beauty brands - POS Production ModelsLuxury beauty brands - POS Production Models
Luxury beauty brands - POS Production Models
 

Similar to Robotlegs Extensions

Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
DHIRAJ PRAVIN
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
kamal kotecha
 
Model Driven Architecture and eXecutable UML
Model Driven Architecture and eXecutable UMLModel Driven Architecture and eXecutable UML
Model Driven Architecture and eXecutable UML
elliando dias
 

Similar to Robotlegs Extensions (20)

Architecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCArchitecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVC
 
systemverilog-interview-questions.docx
systemverilog-interview-questions.docxsystemverilog-interview-questions.docx
systemverilog-interview-questions.docx
 
Vb.net iv
Vb.net ivVb.net iv
Vb.net iv
 
Maf3 - Part 1
Maf3 - Part 1Maf3 - Part 1
Maf3 - Part 1
 
關於 Puremvc Command 的那點事
關於 Puremvc Command 的那點事關於 Puremvc Command 的那點事
關於 Puremvc Command 的那點事
 
Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
How to build typing indicator in a Chat app
How to build typing indicator in a Chat appHow to build typing indicator in a Chat app
How to build typing indicator in a Chat app
 
4Developers: Dominik Przybysz- Message Brokers
4Developers: Dominik Przybysz- Message Brokers4Developers: Dominik Przybysz- Message Brokers
4Developers: Dominik Przybysz- Message Brokers
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
15 sensors and proximity nfc and bluetooth
15   sensors and proximity nfc and bluetooth15   sensors and proximity nfc and bluetooth
15 sensors and proximity nfc and bluetooth
 
RL2 Dot Brighton
RL2 Dot BrightonRL2 Dot Brighton
RL2 Dot Brighton
 
Model Driven Architecture and eXecutable UML
Model Driven Architecture and eXecutable UMLModel Driven Architecture and eXecutable UML
Model Driven Architecture and eXecutable UML
 
Flex Daily Solutions @ FITC 2008
Flex Daily Solutions @ FITC 2008Flex Daily Solutions @ FITC 2008
Flex Daily Solutions @ FITC 2008
 
Maf Event Bus
Maf Event BusMaf Event Bus
Maf Event Bus
 
20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)
 
The Next Step in AS3 Framework Evolution
The Next Step in AS3 Framework EvolutionThe Next Step in AS3 Framework Evolution
The Next Step in AS3 Framework Evolution
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 Summary
 
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdfJEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Robotlegs Extensions

Editor's Notes

  1. Implement Enterprise RIA applications with Java & Flex Following robotlegs for a while now
  2. Short overview of Robotlegs structure
  3. Alternative to events in actionscript
  4. SignalCommand = actually just a Robotlegs Command, but with the advantage that parameters from the signal dispatch call will be automatically injected
  5. Possible to work in a modular fashion with robotlegs without the extension
  6. Mediator which mediates the main view of your module  exists as long as your module  can dispatch module events or listener to events from other modules/shell application
  7. Why OptionCommandMap: - Removes the need for an event class per option - automatic cleanup
  8. Why OptionCommandMap: - Removes the need for an event class per option - automatic cleanup
  9. Dependency injection is performed before executing the commands  no need to worry about that