Asp.Net“插件”架构改进
目前我们有一个架构,其中一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否考虑过MEF?
Have you considered MEF?
正如已经指出的那样,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.