gpt4 book ai didi

inversion-of-control - IoC (Windsor) - 什么是 "Default Interface"?

转载 作者:行者123 更新时间:2023-12-04 18:49:41 26 4
gpt4 key购买 nike

有人可以解释一下两者之间的区别吗

container.Register(AllTypes.FromAssemblyContaining(typeof(BigCompanyRepository))
.WithService.DefaultInterface()


container.Register(AllTypes.FromAssemblyContaining(typeof(BigCompanyRepository))
.WithService.AllInterfaces()

“默认界面”是什么意思?

最佳答案

这是一个启发式 looks for an implementation of an interface by removing the leading I :

  • IFoo -> Foo
  • IBar -> 酒吧
  • IKitchenSink -> KitchenSink

  • 然而,在我看来,使用这个功能有点 over-abundance of 1:1 interfaces 的味道。 .

    关于inversion-of-control - IoC (Windsor) - 什么是 "Default Interface"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8184814/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com