So, what exactly is Automated Dependency Injection?A dependency is just a requirement to use another objectYou can fulfil a dependency in three different waysYou already use Dependency InjectionThere are different ways to inject dependenciesStatics and globals make code rigid, brittle, hard to test, and
prone to memory leaksLocator patterns push extra responsibilities on your
classesAutomated DI gets around the need to ‘pass the parcel’, but keeps
code flexibleHow does Robotlegs Injection work?Automated DI is a handshakeYou can specify an injection point in three waysAnd you also have to tell the injector what you would like it
to doRobotlegs has different types of injectionIf you only want one instance, use mapSingletonmapSingletonOf keeps your code coupled only to
interfacesWhat if my class has to be created elsewhere? (e.g. a
factory)Named rules let you create multiple rules for each class (but
they’re icky)You need to tell the compiler to include the injection
metadataFlashBuilder/FlexBuilder solutionFlash CS4/CS5 IDE SolutionIntelliJ SolutionFlex SDK Solution—command line compilingFlex SDK Solution—compiling with antAutomated Injection ‘Gotchas’If an object has an [Inject]ed dependency you have to create it
using the Injector.You can map injection rules at runtime, but beware of race
conditions.The injection point and rule have to be of exactly the same
typeIf you override a method that has an [Inject] tag, you need to
add it in the subclass