.Net和插件体系结构 [英] .Net and plugin architectures

查看:145
本文介绍了.Net和插件体系结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是插件架构的杰夫和乔尔的讨论继。

插件在C ++中(使用运行时加载的dll)总是有点痛。你必须做大量的基础工作,使他们再插件也必须用C ++编写,往往即使采用相同的编译器。 COM对象和ActiveX解决其中的一些问题,但是介绍了几个他们自己的。
然后添加也就是说,一个Python接口,一个C ++应用程序是一个大量的工作。

我是正确的思想,写入一个.NET语言的所有库(或组件或者无论你怎么称呼他们)总是可以从其他.NET语言叫什么名字?而且可以在对象的数据类型,它们之间的自动传输?

presumably因为所有.NET语言也使用的WinForms(或WPF)的图形用户界面,然后让插件进入主应用程序的图形用户界面也比较简单。

抱歉,如果这是一个很明显的一点,我只是一个老式的C ++程序员。但简洁的通过C ++ / CLI重用现有的C ++库,这使我相信C#/。NET可能是值得进一步调查。

编辑 - 谢谢,我一直在寻找,讨论,如果插件是一个理由去净。如果能够同时有我的商业用户能够写一个简单的插件在VB和技术用户能够手艺高明的东西在F#中没有我做任何更多的工作来写IronPython的似乎是一个很好的理由,从C ++

开关
解决方案
  

我是正确的思想,写入一个.NET语言的所有库(或组件或者无论你怎么称呼他们)总是可以从其他.NET语言叫什么名字?而且可以在对象的数据类型,它们之间的自动传输?

是的。在.NET中,跨语言的兼容性是可能的,因为CTS的(提供一组通用的数据类型的所有.NET兼容的语言使用,并确保类型兼容性)和CLS(定义一组最低标准,所有.NET语言编译器必须符合,从而确保了语言互操作性)。在编译过程中,任何.NET兼容语言的源$ C ​​$ C是由各自的语言编译器转换为中间语言code。由于所有的.NET程序集(EXE或DLL)形式存在中间语言,就可以在它们之间进行互操作。所有.NET兼容的语言使用相同的数据类型,并重新presented因为只有.NET类型。因此,不管你是用INT在Visual Basic .NET C#或整数,在IL是psented为System.Int32的再$ P $。 [来源]

Following on from Jeff and Joel's discussions of plugin architectures.

Plugins in C++ (using runtime loaded dlls) are always a bit of a pain. You have to do a lot of ground work to enable them and then the plugin must also be written in C++, often even with the same compiler. COM objects and ActiveX solved some of these problems but introduced a few of their own.
Then to add say, a python interface, to a C++ app is a large amount of work.

Am I correct in thinking that all libraries (or assemblies or whatever you call them) written in one .Net language can always be called from another .Net language? And can objects an data types be automatically transferred between them?

Presumably since all .Net languages also use Winforms (or WPF) for the gui, then giving plugins access to the main app's gui is also relatively simple.

Sorry if this is a rather obvious point I'm just an old fashioned C++ programmer. But the ease of reusing existing C++ libraries via C++/CLI has convinced me that C#/.Net might be worth more investigation.

Edit - thanks, I was looking to discuss if plugins were a reason to go .Net . Being able to write ironpython while having my business users able to write a simple plugin in VB and technical users be able to craft something clever in F# without me doing any more work seemed a good reason to switch from C++

解决方案

Am I correct in thinking that all libraries (or assemblies or whatever you call them) written in one .Net language can always be called from another .Net language? And can objects an data types be automatically transferred between them?

Yes. In .NET, the cross-language compatibility is possible because of CTS (Offer a set of common data types for use across all .NET compliant languages and ensures type compatibility) and CLS (Defines a set of minimum standards that all .NET language compilers must conform to, and thus ensures language interoperability). During compilation, a source code of any .NET-compliant language is converted to Intermediate Language code by the respective language compiler. As all .NET assembly (EXE or DLL) exists as intermediate language, they can interoperate between them. All .NET compliant languages use the same data types and are represented as .NET types only. Therefore whether you are using int in C# or Integer in Visual Basic .NET, in IL it is represented as System.Int32. [Source]

这篇关于.Net和插件体系结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆