Fitc 2012 - rise of the modules

3,855 views

Published on

FITC 2012 Amsterdam presentation on Robotlegs 2.

Links:
https://github.com/robotlegs/robotlegs-demos-Bundle/tree/rl2/CafeTownsend/src/org/robotlegs/demos/cafetownsend
https://gist.github.com/1923178

Published in: Technology, Business
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,855
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
35
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • \n
  • \n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Wanted: Better Name!\n
  • \n
  • \n
  • But you might often be better off with a Null Implementation\n
  • \n
  • Write Your Own, and extend [Inject], if you like!\n
  • Wrap the global Singleton interface of the Flex logger (and most others)\n
  • - soft prefers mappings in ancestor injectors, strong is default\n- Modules can work in isolation and in bigger contexts\n
  • - local prevents sharing with child injectors, shared is default\n
  • Allows setting a provider that will get called as a last-ditch effort if no mapped provider is found for a type\nNot yet implemented\n
  • PRE_INSTANTIATE | PRE_INSTANTIATE: Before and after creating a new instance\nPRE_CONSTRUCT | POST_CONSTRUCT: Before and after injecting into an instance\n
  • Removes all mappings and invokes [PreDestroy] methods on all singletons\nNot yet implemented\n
  • Prevents any changes to the mapping at all\nAllows usage of untrusted modules\nCan only be reverted with the unique key returned by seal()\n
  • \n
  • getInstance instantiates concrete types even without mapping\n
  • Enables instance-pooling\n
  • With Flash Player 10.1 and above\n
  • Work in Progress\n
  • \n
  • makes decoupling through an IoC Container easy\nenables integration of actual functionality\nnot built around the Display List or an EventDispatcher\n
  • makes decoupling through an IoC Container easy\nenables integration of actual functionality\nnot built around the Display List or an EventDispatcher\n
  • makes decoupling through an IoC Container easy\nenables integration of actual functionality\nnot built around the Display List or an EventDispatcher\n
  • Child Contexts get Child Injectors\nMultiple contextViews enable lower and upper GUIs for Games\n
  • Child Contexts get Child Injectors\nMultiple contextViews enable lower and upper GUIs for Games\n
  • \n
  • Contains all the functionality of RL1 and much more\n
  • Case in point: ClassicRobotlegsBundle contains 12 extensions\n
  • Just include the SWC and require the Extension during Context Building\nExample later\n
  • \n
  • \n
  • Example: the MediatorMap shouldn’t know specifics of the mapping\n
  • Terms that work in one place work the same in other, similar places\nExample: `map` in CommandMap, Injector, MediatorMap\n`map` takes something available, `toX` something to create or return\n
  • Guards enable finer-grained, customized mappings\nGuards: Validation\nHooks: Logging, Styling, Skinning\n
  • Guards enable finer-grained, customized mappings\nGuards: Validation\nHooks: Logging, Styling, Skinning\n
  • \n
  • Use the classic Display List, Starling, 3D frameworks, Bitmap Rendering, Speakers/ Microphone, Camera\n(Lines between views and services blur, if you ask me. Think Chat Rooms)\n
  • AKA Covariant Mediation\nEnables complete decoupling from view implementation details\n
  • \n
  • Swiftsuspenders 2 should be fully compatible, but better Safe Than Sorry\nSpecial build of Robotlegs 1.5.2 with Swiftsuspenders 2 included\n
  • There’s an extension for that\nReplace RL1 SWC with RL2 and migration-extension\ntest\n
  • There’s still a Context, but you don’t extend it\nInstead, you install Extensions and Configurations into it\n
  • I’ll put Regexp’s on github\n\n
  • I’ll put Regexp’s on github\n\n
  • I’ll put Regexp’s on github\n\n
  • I’ll put Regexp’s on github\n\n
  • I’ll put Regexp’s on github\n\n
  • \n
  • \n
  • Fitc 2012 - rise of the modules

    1. 1. [robotlegs]
    2. 2. [robotlegs]Rise of the Modules
    3. 3. Once Upon aTime in Spain
    4. 4. A little bit of Background Meetup in Spain+ Meetup in Sherwood Forest + Great Community-Ideas == What RL2 is all about
    5. 5. Swiftsuspenders 2
    6. 6. Swiftsuspenders 2Fluent Interface
    7. 7. Swiftsuspenders 2 - Fluent Interfaceinjector.map(type:Class)
    8. 8. Swiftsuspenders 2 - Fluent Interfacemap(type:Class, name:String = )
    9. 9. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).asSingleton()
    10. 10. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toSingleton(type:Class)
    11. 11. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toType(type:Class)
    12. 12. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toValue(value:Object)
    13. 13. Swiftsuspenders 2New Features
    14. 14. Swiftsuspenders 2 - New Features[Inject(optional=true)]
    15. 15. Swiftsuspenders 2 - New Featuresmap(type:Class).toProvider( provider:DependencyProvider)
    16. 16. Swiftsuspenders 2 - New Features DependencyProvider:apply(targetType:Class, injector:Injector, injectParameters:Array):Object
    17. 17. Swiftsuspenders 2 - New Features Example:return Log.getLogger(getQualifiedClassName(targetType));
    18. 18. Swiftsuspenders 2 - New Featuresmap(type:Class).soft() //and .strong()
    19. 19. Swiftsuspenders 2 - New Featuresmap(type:Class).local() //and .shared()
    20. 20. Swiftsuspenders 2 - New Featuresinjector.setDefaultProvider(provider);
    21. 21. Swiftsuspenders 2 - New Features injector dispatches PRE_INSTANTIATE, POST_INSTANTIATE,PRE_CONSTRUCT and POST_CONSTRUCT
    22. 22. Swiftsuspenders 2 - New Featuresinjector.destroy()
    23. 23. Swiftsuspenders 2 - New Featuresmap(type:Class).seal():Object ( and unseal(key:Object))
    24. 24. Swiftsuspenders 2Changes
    25. 25. Swiftsuspenders 2 - ChangesNo More injector.instantiate(type:Class)
    26. 26. Swiftsuspenders 2 - ChangesCan Re-Inject Into Instances
    27. 27. Swiftsuspenders 2 - Changes> 500% Faster Reflection > 300% Faster Injection
    28. 28. Robotlegs 2
    29. 29. Robotlegs 2Modularity
    30. 30. Robotlegs 2 - Modularity Lean Core
    31. 31. Robotlegs 2 - Modularity Lean CoreA Toolkit around an Injector
    32. 32. Robotlegs 2 - Modularity Lean CoreA Toolkit around an InjectorContains nearly no user-facing functionality
    33. 33. Robotlegs 2 - Modularity Lean CoreA Toolkit around an InjectorContains nearly no user-facing functionalityMakes no assumptions about how you work
    34. 34. Robotlegs 2 - ModularityApplication Modularity built-in
    35. 35. Robotlegs 2 - ModularityApplication Modularity built-inNested Contexts Just Work
    36. 36. Robotlegs 2 - ModularityApplication Modularity built-inNested Contexts Just WorkMultiple contextViews per Module
    37. 37. Robotlegs 2Extensions
    38. 38. Robotlegs 2 - ExtensionsRL2 is Batteries Included
    39. 39. Robotlegs 2 - Extensions Bundles make usingmultiple Extensions easy
    40. 40. Robotlegs 2 - ExtensionsInstalling 3rd party Extensions is a Piece Of Cake
    41. 41. Robotlegs 2Usage
    42. 42. Robotlegs 2 - UsageDSLs FTW!
    43. 43. Robotlegs 2 - UsageChaining separates Concerns
    44. 44. Robotlegs 2 - UsageConsistent and Meaningful Naming of Methods
    45. 45. Robotlegs 2 - UsageGuards and Hooks everywhere
    46. 46. Robotlegs 2 - UsageGuards and Hooks everywhere Guards conditionally prevent activity
    47. 47. Robotlegs 2 - UsageGuards and Hooks everywhere Guards conditionally prevent activity Hooks inform about activity
    48. 48. Robotlegs 2In Other News
    49. 49. Robotlegs 2 - In Other NewsView Agnosticism
    50. 50. Robotlegs 2 - In Other NewsRole-Based Mediation
    51. 51. Robotlegs 2The Port
    52. 52. Robotlegs 2 - The PortPhase I: Verify the Injector
    53. 53. Robotlegs 2 - The PortPhase II: Port without Porting
    54. 54. Robotlegs 2 - The PortPhase III: De-Monolithicize
    55. 55. Robotlegs 2 - The PortPhase IV: De-Cruft
    56. 56. Robotlegs 2 - The Port Phase IV: De-CruftMigrate to new Injector API
    57. 57. Robotlegs 2 - The Port Phase IV: De-CruftMigrate to new Injector API CommandMap API
    58. 58. Robotlegs 2 - The Port Phase IV: De-CruftMigrate to new Injector API CommandMap API MediatorMap API
    59. 59. Robotlegs 2 - The Port Phase IV: De-CruftMigrate to new Injector API CommandMap API MediatorMap APIAdd [PostConstruct] to your Mediators
    60. 60. Robotlegs 2 - The Port Phase IV: De-CruftMigrate to new Injector API CommandMap API MediatorMap APIAdd [PostConstruct] to your MediatorsRemove Actor and Command
    61. 61. Robotlegs 2An Example
    62. 62. Robotlegs 2 - An Example Porting Jon Toland’sCafeTownsend Implementation

    ×