What conventions/idioms/patterns are you using configuring IOC Containers using the new Fluent Interfaces

后端 未结 4 1502
孤独总比滥情好
孤独总比滥情好 2021-02-06 11:13

I am in the middle of moving over a large body of code to Castle Trunk which includes the new fluent interface for configuring the container. Since the project has a huge windso

4条回答
  •  天涯浪人
    2021-02-06 11:56

    Tricky questions [and I'm no IoC expert] but keep in mind that any "monolithic static function" should not be nearly as scary as the config file. You can define your own conventions for things, and try to abstract things down. I use Ninject, but for Windsor, I'd imagine it would involve making short little functions using things like Register with the AllTypesOf strategy:

    kernel.Register(AllTypesOf.
        FromAssembly(Assembly.Load("SomeAssembly")));
    

    Don't know about the internal hierarchies exporting their own default configuration. That seems a little scary and inverted.

提交回复
热议问题