|
|||||
|
|||||
User DocumentationOne minute descriptionTwo minute tutorial Five minute introduction Advanced Topics FAQ Container Components Terminology Mock Objects Inversion of Control Types PatternsInversion of ControlDependency Injection Constructor Injection Setter Injection Interface Implementation Separation Lifecycle Antipatterns Developer DocumentationHow To Contribute Relative Volunteering Release Process Project InformationSloganMailing lists Source Repositories Open Issues Blog entries Statistics Team Sister Projects TShirts MiscellaneousDifferentiatorsNirvana Full SitemapFeeds
|
Author: Dan North OverviewRico is a container written in Ruby, demonstrating the same Inversion-of-Control principles as the Java Pico Container. It is primarily a proof of concept at this stage - there is an embarrassingly small amount of actual code but it seems to cover the fundamentals. The Constructor Injector IoC model depends on the signature of the constructor(s) of an object to identify its dependencies. Ruby does not have static types, so we use a list of keys to represent dependencies, passed in when we register a component. Basic operationrequire 'rico' # the main container include Rico # so we don't need to use Rico:: everywhere container = Rico.new
Additional behaviourRico has the same multicasting behaviour as Pico - you can call methods on a multicaster object and any registered components that understand the method will have it called. This is useful for lifecycle management. Next stepsRico currently doesn't support the same ComponentAdapter model as Pico, which would bring it much more into line. Also we need a sample app or two to demonstrate how it works. |
||||
|