Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
robotlegs
robotlegs 2.0
the goals
configurable because every project is unique
versatile    rigidity sucks
conciseuse only what you need
fluentmake(tea).with(milk).butNot(sugar)
govt health warningthese examples are subject to change
the features
.context builder
Contexts in robotlegs circa v1
Contexts in robotlegs circa v1public class Context{	 	 protected var _injector:IInjector;	 	 protected var _reflector:IRef...
public class Container{   private var youCantSeeMe:SoLetsHopeIKnowWhatImDoing;    protected var sureYouCanOverrideMe:ButYo...
public class Container{   private var youCantSeeMe:SoLetsHopeIKnowWhatImDoing;    protected var sureYouCanOverrideMe:ButYo...
RL2 contexts are created with what you need                          not extended with what you don’t
Introducing the context builder
Introducing the context builderpublic interface IContextBuilder{  build():IContext;    withBundle(bundle:IContextBuilderBu...
.withConfig
.withConfigpublic interface IContextConfig{   function configure(context:IContext):void;}setup your configuration to execu...
.withExtension
.withExtensionpublic interface IContextExtension{	 function initialize(context:IContext):void;	   function install(context...
.withProcessor
.withProcessorpublic interface IContextProcessor{	 function process(context:IContext, callback:Function):void;}processors ...
.pre-configured bundles
four tasty flavours of robotlegs         each representing a context builder bundle
Original»when plain old vanilla is just right.
light»   when size and performance are paramount.
rapid»when time is of the essence.
» smart viewswhen you simply can’t live without view injection.
.type matching
Definion
Definionpublic class   TypeMatcher{    function   anyOf(... params):TypeMatcher;    function   noneOf(... params):TypeMatc...
.view management
viewManager.addContainer(contextView);	    viewManager.addHandler(mediatorMap);	    viewManager.addWatcher(stageWatcher); ...
viewManager.addContainer(contextView);	    viewManager.addHandler(mediatorMap);	    viewManager.addWatcher(stageWatcher); ...
.mediate anything
mediatorMap.map(UserDetailsMediator).toView(IUserDetailsAware);            map mediators to interfaces rather than        ...
mediatorMap.map(UserDetailsMediator).toView(IUserDetailsAware);              map mediators to interfaces rather than      ...
.guards and hooks
possible use-cases for a guard:
possible use-cases for a guard:•   prevent mediation when ...
possible use-cases for a guard:• prevent mediation when ...• prevent command execution when ...
possible use-cases for a guard:• prevent mediation when ...• prevent command execution when ...mediatorMap	 .map(UserDetai...
scenarios for using a hook:
scenarios for using a hook:•   customised logging
scenarios for using a hook:• customised logging• view skinning
scenarios for using a hook:• customised logging• view skinning• view localisation
scenarios for using a hook:• customised logging• view skinning• view localisation• instance configuration prior to command...
scenarios for using a hook:• customised logging• view skinning• view localisation• instance configuration prior to command...
scenarios for using a hook:• customised logging• view skinning• view localisation• instance configuration prior to command...
.rule sets and command flow
possible uses of a rule:
possible uses of a rule:•   adding or removing mediators
possible uses of a rule:• adding or removing mediators• loading or unloading commands
possible uses of a rule:• adding or removing mediators• loading or unloading commandsa rule can prevent or ensure an actio...
command flows:
command flows:create a workflow of commands to represent acomplex sequence
command flows:create a workflow of commands to represent acomplex sequenceflows are pathways between commands
.swift-suspenders integration
//creates a new instance per injectioninjector.map(SomeType); //or injector.map(SomeType, ‘named’);//create new instance p...
.module integration
integrated module automation:
integrated module automation:•   context wired up by parent once added to stage
integrated module automation:•   context wired up by parent once added to stage•   view events are collated in the one vie...
integrated module automation:•   context wired up by parent once added to stage•   view events are collated in the one vie...
integrated module automation:•   context wired up by parent once added to stage•   view events are collated in the one vie...
integrated module automation:•   context wired up by parent once added to stage•   view events are collated in the one vie...
.robotlegs inspector
new inspector             gadget tool to             help you with             your             robotlegging.info here.
an example in covariance         mediate behaviours not views
for comparison
for comparisonlet’s look at a simple robotlegs v1 application
invariant mediation (via classes)
invariant mediation (via classes)                            View
invariant mediation (via classes)                            View         Mediator
invariant mediation (via classes)                            View         Mediator
invariant mediation (via classes)                    events                             View         Mediator
invariant mediation (via classes)                    events                             View         Mediator             ...
what’s wrong with this approach?
what’s wrong with this approach?•   the mediator is tightly coupled to the view
what’s wrong with this approach?•   the mediator is tightly coupled to the view•   view is restricted to one mediator
what’s wrong with this approach?•   the mediator is tightly coupled to the view•   view is restricted to one mediator•   n...
how to fix this in v1?
how to fix this in v1?using the variance utility
covariant mediation (via interfaces)
covariant mediation (via interfaces)                     View
covariant mediation (via interfaces)                        View                   IBehaviour A                           ...
covariant mediation (via interfaces)                        View   Mediator A                   IBehaviour A              ...
covariant mediation (via interfaces)                        View   Mediator A                   IBehaviour A              ...
covariant mediation (via interfaces)                       e v e n t s                                     View   Mediator...
covariant mediation (via interfaces)                          e v e n t s                                        View   Me...
what is wrong with this contract?
what is wrong with this contract? import flash.events.IEventDispatcher; [Event(name="doAsync", type="...ControlEvent")] pu...
.enter signals, stage right
with signals, we define the contract
with signals, we define the contract  import org.osflash.signals.ISignal;  public interface IServiceStarter  {  	   functi...
with covariance and signals
with covariance and signals                      View                 IBehaviour A                           IBehaviour B ...
with covariance and signals                            View   Mediator A                       IBehaviour A               ...
with covariance and signals                            View   Mediator A                       IBehaviour A               ...
with covariance and signals                            View   Mediator A                       IBehaviour A               ...
to view this sample online go to j.mp/covariance    Libraries used:    •   robotlegs 1.5.2    •   robotlegs variance utili...
so when is robotlegs 2             coming?
...now.
as of this afternoonrobotlegs 2 is in open beta.
Stay updated.
Stay updated.  Add you name to the RL2 beta list by commenting on:  j.mp/robotlegs2  Join the robotlegs google group  Foll...
fin.about.me/justinj@justinjmoses
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
.withExtension
Upcoming SlideShare
Loading in …5
×
23,893 views

Published on

.withExtension

Published in: Technology
  • Be the first to comment

×