Publicidad
Publicidad

Más contenido relacionado

Publicidad

RL2 Dot Brighton

  1. RL2 ActionScript Application Framework Dot Brighton - 2012 1
  2. hello, I’m shaun smith @darscan #robotlegs http://shaun.boyblack.co.za/blog/about/ 2
  3. RL1 Recap Dependency Injection Commands Mediators https://github.com/robotlegs/robotlegs-framework/tree/master 3
  4. RL2 As above, but with: A fluent API Extensions (opt-in) Bundles (presets) Configs Logging (built-in) Module autowiring https://github.com/robotlegs/robotlegs-framework/tree/version2 4
  5. Dependency Injection https://github.com/tschneidereit/SwiftSuspenders/ 5
  6. Swiftsuspenders 2 injector.map(IService).toValue(service) injector.map(IService).toType(SomeService) injector.map(IService).toSingleton(SomeService) injector.map(SomeService).asSingleton() Faster Local vs shared scopes Hard vs soft mappings https://github.com/tschneidereit/SwiftSuspenders/ 6
  7. Context & Startup framework/readme-context.md 7
  8. context = new Context() .extend(MVCSBundle) .configure(MyAppConfig, this); No more extend and override Opt-in extensions Convenient, shareable bundles Conventions for configuration Consolidated startup process framework/readme-context.md 8
  9. Commands extensions/eventCommandMap 9
  10. eventCommandMap .map(SomeEvent.EVENT, SomeEvent) .toCommand(MyCommand) .once(); extensions/eventCommandMap 10
  11. Mediators extensions/mediatorMap 11
  12. mediatorMap .map(SomeType) .toMediator(SomeMediator) Can map to interfaces and abstract types Possibly many mediators per view Nested stage listener optimisations extensions/mediatorMap 12
  13. Configs framework/readme-context.md 13
  14. context = new Context() .extend(MVCSBundle) .configure(MyAppConfig, this); framework/readme-context.md 14
  15. class ViewConfig { public function ViewConfig(mediatorMap:IMediatorMap) { mediatorMap.map(SomeView) .toMediator(SomeMediator); } } framework/readme-context.md 15
  16. class MyModuleConfig implements IConfig { [Inject] public var mediatorMap:IMediatorMap; public function configure():void { mediatorMap.map(SomeView) .toMediator(SomeMediator); } } framework/readme-context.md 16
  17. Extensions extensions 17
  18. public class EventCommandMapExtension implements IExtension { public function extend(context:IContext):void { context.injector .map(IEventCommandMap) .toSingleton(EventCommandMap); } } extensions/eventCommandMap 18
  19. Extensions are installed immediately: context.extend(MyExtension) ~= new MyExtension().extend(context) extensions 19
  20. Bundles bundles 20
  21. context = new Context() .extend(MVCSBundle) .configure(MyAppConfig, this); bundles 21
  22. public class MVCSBundle implements IBundle { public function extend(context:IContext):void { context.extend( ModularityExtension, EventCommandMapExtension, ... etc ... MediatorMapExtension, StageSyncExtension); context.configure(ContextViewListenerConfig); } } bundles/mvcs 22
  23. Bundles are installed immediately: context.extend(MyBundle) ~= new MyBundle().extend(context) bundles 23
  24. Bundles vs Extensions extensions 24
  25. An extension integrates a single utility or library with a Robotlegs context A bundle installs a selection of extensions and configurations into a Robotlegs context extensions 25
  26. Logging framework/readme-logging.md 26
  27. Lightweight logging system built in: context.getLogger(MyClass) Optional logging extensions LoggingExtension: allows you to [Inject] public var logger:ILogger; InjectorLoggingExtension: logs injection events (not 4 production!) TraceLoggingExtension: simple trace log target extensions/logging 27
  28. Demos github urls to follow 28
  29. https://github.com/darscan/robotlegs-demos-HelloFlash https://github.com/darscan/robotlegs-demos-HelloFlex https://github.com/darscan/robotlegs-demos-Todo github.com 29
  30. Thanks! https://github.com/robotlegs/robotlegs-framework 30
  31. Questions? 31

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
Publicidad