Asp.Net“插件”架构改进

发布于 2024-12-18 22:41:38 字数 136 浏览 3 评论 0原文

目前我们有一个架构,其中一个 dll 被放入包含某个类的 bin 文件夹中,然后主应用程序使用反射查找该类,并运行一个特定的方法来执行此处不重要的功能,

显然反射会产生其他问题,并且开销相当大……除了反射之外,我们还可以做/使用什么其他事情?

At the moment we have an architecture where a dll is dropped into the bin folder which contains a certain class, the main application then looks for that class, using reflection, and runs a specific method which performs a function which isn't important here

Clearly reflection creates other issues, and has quite a large overhead...what other things could we do/use instead of reflection?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

〃安静 2024-12-25 22:41:38

您是否考虑过MEF

Have you considered MEF?

冷夜 2024-12-25 22:41:38

正如已经指出的那样,MEF 是一个不错的选择 - 它的整体精神是可插拔架构。

如果您多次执行反射,那么反射的开销实际上只是一个问题。如果您缓存找到的类型,那么您将不必再次寻找它们。

MEF as already stated is a good option - it's whole ethos is pluggable architecture.

The overhead of reflection is really only a problem if you do it multiple times.. if you cache the types you find then you won't have to go looking for them again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文