[ANN] Needle 1.2.0發佈


   Project page: http://rubyforge.org/projects/needle
   User Manual:  http://needle.rubyforge.org
   API Docs:     http://needle.rubyforge.org/api
   FAQ Document: http://needle.rubyforge.org/faq.html
   Needle Wiki:  http://needle.rubyforge.org/wiki/wiki.pl

1.2引入了一些新的特點,修正了一些錯誤:

   * Parameterized services. You can now specify parameters when
requesting a service, and (unless the service model in use is
incompatible with extra parameters, like singleton) those parameters
will be passed to the constructor block of the service. This allows, for
example:

   * Multiton services. You can use a multiton service model when
registering a service, and then every unique set of parameters used when
requesting a service will result in the caching of the returned object,
to be reused whenever the same parameter set is given.

   * :log_for is a new parameterized service that provides more
convenient access to a registry's log factory. Just pass the name of the
log you want (or the service point to obtain a log for) to the :log_for
service when requesting it:

       log1 = c.log_for( "foo" )
       log2 = c.log_for( point )

   * DefinitionContext now passes all unknown messages through to its
container, making it possible to access parameterized services via the
definition context.

   * Updated the manual and FAQ documents to include the new features
described above.

   * Fixed several bugs and documentation typos.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章