开发者

NServiceBus configuration interface question

In the NServiceBus interface, why are some things 开发者_Go百科configured like this:

NServiceBus.Configure.Instance.Configurer.ConfigureComponent(ComponentCallModelEnum.Singleton);

And some things are configured like this:

NServiceBus.Configure.With().DoNotAutoSubscribe();

What is the significance of "Instance" here?


In the first case you are configuring a specific component into the NSB container. For instance you may want to load an NH ISessionFactory into the NSB container as a singleton object. In the second case you are configuring NSB behaviour. The "Instance" is simply a way to statically access the Configure class. Using "With" forces certain configuration behaviour including the order in which things are configured.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜