[Swiftsuspenders]
Reasons for usingInversion of Control
Reasons for using Inversion of ControlSeparation of Concerns
Reasons for using Inversion of ControlCreation of complex Graphs
Reasons for using Inversion of Control     Reduce Coupling bygetting rid of the Middle-Man
Reasons for using Inversion of Control Reduce Coupling byDepending on Interfaces
What is an IoC-Container?
What is an IoC-Container?    An Interpreter forDependency Configuration
What is an IoC-Container?A Map of Request->Response-   Pairs for Dependencies
What is an IoC-Container?A Factory for Object-Graphs
What makesIoC-Containers Complex?
What makes IoC-Containers Complex? Easy, Light-WeightConfiguration is Hard
What makes IoC-Containers Complex?Ctor- and Method-Injection
What makes IoC-Containers Complex?Named Injections
What makes IoC-Containers Complex?  Different Ways toProvide Dependencies
What makes IoC-Containers Complex?    Live-Cycle
What makes IoC-Containers Complex?Child-Injectors
What makes IoC-Containers Complex?  Performance
Swiftsuspenders 2
Swiftsuspenders 2Fluent Interface
Swiftsuspenders 2 - Fluent Interfaceinjector.map(type:Class)
Swiftsuspenders 2 - Fluent Interfacemap(type:Class, name:String = )
Swiftsuspenders 2 - Fluent Interfacemap(type:Class).asSingleton()
Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toSingleton(type:Class)
Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toType(type:Class)
Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toValue(value:Object)
Swiftsuspenders 2New Features
Swiftsuspenders 2 - New Featuresmap(type:Class).setProvider(   provider:DependencyProvider)
Swiftsuspenders 2 - New Features        DependencyProvider:apply(targetType:Class, injector:Injector):Object
Swiftsuspenders 2 - New Featuresmap(type:Class).soft() //and .strong()
Swiftsuspenders 2 - New Featuresmap(type:Class).local() //and .shared()
Swiftsuspenders 2 - New Featuresinjector.setDefaultProvider(provider);
Swiftsuspenders 2 - New Features      injector dispatches PRE_INSTANTIATE, POST_INSTANTIATE,PRE_CONSTRUCT and POST_CONSTRUCT
Swiftsuspenders 2 - New Featuresinjector.destroy()
Swiftsuspenders 2 - New Featuresinjector.teardown(instance:Object):Boolean
Swiftsuspenders 2Changes
Swiftsuspenders 2 - ChangesNo More injector.instantiate(type:Class)
Swiftsuspenders 2 - Changes   injector.getInstance(type:Class)Invokes Provider or Uses “new type()”
Swiftsuspenders 2 - ChangesCan Re-Inject Into Instances
Swiftsuspenders 2 - Changes> 500% Faster Reflection
Swiftsuspenders 2 - Changes> 300% Faster Injection
Swiftsuspenders 2 - Changes + 2.5kb size
Upcoming SlideShare
Loading in …5
×

try { harder } 2011 Inception of Control

1,014 views
930 views

Published on

Slides for my talk at try { harder } 2011 on IoC containers in general and the Swiftsuspenders AS3 project and its roadmap specifically.

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

  • Be the first to like this

No Downloads
Views
Total views
1,014
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Can be metadata, XML, MXML, JSON, etc, a DSL or just normal code\n
  • Requests are formulated by whatever config mechanism, responses set via an API\n
  • Using the configuration-data to find dependencies of the root, then providing them recursively\n
  • \n
  • Reflection not that easy, finding good DSLs even harder\n
  • - finding all dependencies for args\n- invoking Ctors (no splat)\n
  • Make lookup more complicated\n
  • Class-Factories, Values, Singletons, Multitons, generic Factories, etc.\n
  • PostConstruct: Sorting\ndestroy/ PreDestroy: What to tear-down?\n
  • PostConstruct: Sorting\ndestroy/ PreDestroy: What to tear-down?\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Wanted: Better Name!\n
  • \n
  • \n
  • \n
  • Write Your Own!\n
  • - \n- Modules can work in isolation and in bigger contexts\n
  • \n
  • Allows setting a provider that will get called as a last-ditch effort if no mapped provider is found for a type\n
  • PRE_INSTANTIATE | PRE_INSTANTIATE: Before and after creating a new instance\nPRE_CONSTRUCT | POST_CONSTRUCT: Before and after injecting into an instance\n
  • \n
  • Better Name Wanted!\n
  • \n
  • \n
  • \n
  • Enables instance-pooling\n
  • With Flash Player 10.1 and above\n
  • \n
  • From 7.7kb to 9.2kb\n
  • try { harder } 2011 Inception of Control

    1. 1. [Swiftsuspenders]
    2. 2. Reasons for usingInversion of Control
    3. 3. Reasons for using Inversion of ControlSeparation of Concerns
    4. 4. Reasons for using Inversion of ControlCreation of complex Graphs
    5. 5. Reasons for using Inversion of Control Reduce Coupling bygetting rid of the Middle-Man
    6. 6. Reasons for using Inversion of Control Reduce Coupling byDepending on Interfaces
    7. 7. What is an IoC-Container?
    8. 8. What is an IoC-Container? An Interpreter forDependency Configuration
    9. 9. What is an IoC-Container?A Map of Request->Response- Pairs for Dependencies
    10. 10. What is an IoC-Container?A Factory for Object-Graphs
    11. 11. What makesIoC-Containers Complex?
    12. 12. What makes IoC-Containers Complex? Easy, Light-WeightConfiguration is Hard
    13. 13. What makes IoC-Containers Complex?Ctor- and Method-Injection
    14. 14. What makes IoC-Containers Complex?Named Injections
    15. 15. What makes IoC-Containers Complex? Different Ways toProvide Dependencies
    16. 16. What makes IoC-Containers Complex? Live-Cycle
    17. 17. What makes IoC-Containers Complex?Child-Injectors
    18. 18. What makes IoC-Containers Complex? Performance
    19. 19. Swiftsuspenders 2
    20. 20. Swiftsuspenders 2Fluent Interface
    21. 21. Swiftsuspenders 2 - Fluent Interfaceinjector.map(type:Class)
    22. 22. Swiftsuspenders 2 - Fluent Interfacemap(type:Class, name:String = )
    23. 23. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).asSingleton()
    24. 24. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toSingleton(type:Class)
    25. 25. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toType(type:Class)
    26. 26. Swiftsuspenders 2 - Fluent Interfacemap(type:Class).toValue(value:Object)
    27. 27. Swiftsuspenders 2New Features
    28. 28. Swiftsuspenders 2 - New Featuresmap(type:Class).setProvider( provider:DependencyProvider)
    29. 29. Swiftsuspenders 2 - New Features DependencyProvider:apply(targetType:Class, injector:Injector):Object
    30. 30. Swiftsuspenders 2 - New Featuresmap(type:Class).soft() //and .strong()
    31. 31. Swiftsuspenders 2 - New Featuresmap(type:Class).local() //and .shared()
    32. 32. Swiftsuspenders 2 - New Featuresinjector.setDefaultProvider(provider);
    33. 33. Swiftsuspenders 2 - New Features injector dispatches PRE_INSTANTIATE, POST_INSTANTIATE,PRE_CONSTRUCT and POST_CONSTRUCT
    34. 34. Swiftsuspenders 2 - New Featuresinjector.destroy()
    35. 35. Swiftsuspenders 2 - New Featuresinjector.teardown(instance:Object):Boolean
    36. 36. Swiftsuspenders 2Changes
    37. 37. Swiftsuspenders 2 - ChangesNo More injector.instantiate(type:Class)
    38. 38. Swiftsuspenders 2 - Changes injector.getInstance(type:Class)Invokes Provider or Uses “new type()”
    39. 39. Swiftsuspenders 2 - ChangesCan Re-Inject Into Instances
    40. 40. Swiftsuspenders 2 - Changes> 500% Faster Reflection
    41. 41. Swiftsuspenders 2 - Changes> 300% Faster Injection
    42. 42. Swiftsuspenders 2 - Changes + 2.5kb size

    ×