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 A. The Butterfly Container

Contributed by Jakob Jenkov

This appendix is about the Butterfly DI DSL called Butterfly Container Script (BCS). We include this appendix to illustrate the last of the four configuration mechanisms mentioned in chapter 2.

A DSL for dependency injection

What we show here is far from a complete listing of the capabilities of Butterfly Container. Rather we show a few of Butterfly Container's solutions; these problems are also mentioned elsewhere in this book:

  • Contextual injection via input parameters

  • Reinjection via factory injection

This appendix also looks at a few features made possible by a DSL.

Application configuration

Butterfly Container is an open source project and is part of a growing collection of components ...

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