O'Reilly logo

Dependency Injection: Design patterns using Spring and Guice by Dhanji R. Prasanna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. SmartyPants for Adobe Flex

Contributed by Josh McDonald

SmartyPants-IOC is a dependency injection framework for use in building Adobe Flex and Flash applications inspired by Google Guice for Java. It's based on key concepts:

  • The class+name key

  • Injector requests, usually specified via metadata

  • Injector rules, specified using an ActionScript-based DSL

The class+name key

Whether you're telling SmartyPants-IOC what to provide or sitting around with your hand out asking for a dependency, the key is the same: a combination of a class and a name. You must specify the class, but the name is optional.

Injection annotations

How do you actually request that a field be injected? In most circumstances you need to annotate your fields with ActionScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required