开发者

Castle Windsor - single place for component install?

After reading the documentation (http://stw.castleproject.org/Windsor.Installers.ashx) I've found a strange part:

Although technically it's OK to call Install multiple times, or register components outside of installers it is considered good practice to encapsulate all registration in installers, and to install all installers during a single call to Install. It is quite possible that in future versions Windsor will be optimized for such usage.

Okay, good practice, agree. This is okay when I'm able to load all my assemblies at startup, but what to do when not?

Let's say my shell starts, user logs in, assemblies coming开发者_如何学运维 based on roles, assemblies coming based on actions etc. Normal situation in an mid-sized enterprise application.

Any idea, comment, note? I'm especially interessed in performance trade-offs.


If you cannot install all components at once, you just can't. It's just a recommendation.

The reason it's recommended is because installing all components at once will give a consistent experience to your application. If you add them later, a component that would not resolve at one moment, would later on, or would resolve differently.

If you take care handling such cases (i.e. you know what you're doing), you should be safe.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜