Appendix A. The Butterfly Container
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.
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.
Butterfly Container is an open source project and is part of a growing collection of components called Butterfly Components. Should you be interested in learning more, you can find additional information at http://butterfly.jenkov.com.
For reasons too involved to discuss here, Butterfly Container was designed to use a DSL tailored to dependency injection for its configuration. This mechanism is somewhat similar to the XML files of Spring, except BCS is not an XML format.