Needle-Extras是Needle的附加庫,可以和Needle一起使用來建立應用程序。這也是本軟件第一次發佈,包括如下內容:
* AttrInject: this is an implementation of interface injection for
Needle, based on an implementation by Christian Neukirchen (thanks,
chris2!) This allows you to specify the dependencies of a class via an
"attr_inject" macro/method. Then, you use a special service model (e.g.
"singleton_inject", or "prototype_inject"), which makes sure that those
declared dependencies are satisfied when the service is instantiated.
It's not as powerful as it could be (yet), but it makes a good
technology demonstration.
* Multicast: this is a service that allows you to create "multicast"
services--services that delegate their methods to a list of other services.
* RequireLibrary: this is actually a mini-framework for allowing
libraries to register themselves with Needle, making it easier for
clients to depend on third-party service libraries.