有此处的说明,使用SimMetrics库。他们提供给这个图书馆的链接是 SourceForge 。它似乎最新版本的SimMetrics库是用Java创建的。是否可能编译java代码,然后在C#中引用它以在SQL Server 2008中用作程序集?
解决方案最好的方法是使用最少的代码更改,将J#(现在已经过时,大部分不受支持)编译为java# 。
- 这非常依赖于使用了多少图书馆。
- 这在高度数学代码上有时可以很容易。作为一个优点,java代码可能会采用16位unicode。
- 这可能是完全不可能的与sql server托管的运行时,当然我会认为性能会很差(因为你必须在每个呼叫的主机屏障之间thunk。
SF页面 strong 暗示存在java和版本。 这是最新的。net release 和文档
但是,根据
原始.NET实现的版本,而不是最新Java代码的转换。
.Net实现主要是c#,所以你可以比较java实现中的最新变化,然后尝试在.Net代码中重新创建它们。由于转换为c#似乎在很大程度上是一个直接的副本,只是基于惯用的c#(骆驼壳,属性和参数名称)的基本考虑,你很有可能做到这一点。
如果您考虑将更改提交为修补程序,这将使您有机会让别人验证您的更改,并可能会启动.Net端未来,项目将保持更密切的同步。
There are instructions here to create a C# assembly using the SimMetrics library. The link they provided to this library is at SourceForge. It looks like the most recent version of the SimMetrics library was created in Java. Is it possibly to compile java code and then reference it in C# to be used as an assembly in SQL Server 2008?
解决方案The best you can do is
- this is very dependent on how much of the libraries are used.
- this can sometimes be fairly easy on highly mathematical code. As an advantage the java code likely assumes 16 bit unicode as well.
- this may be outright impossible with the sql server hosted runtime, certainly I would think the performance would be poor (since you would have to 'thunk' across the hosting barrier on each call.
The SF page strongly implies that there is both a java and a release. Here's the latest release and documentation
However based on the read me file in that
This is an updated version of the original .NET implementation and not a conversion of the newest Java Code.
The .Net implementation is largely c# so you could diff the recent changes in the java implementation then attempt to recreate them in the .Net code. Since the conversion to c# seems to be largely a direct copy with only basic consideration given to idiomatic c# (camel casing, properties and parameter names) you stand a good chance of being able to do this.
If you do consider submitting the changes as a patch, this would give you a chance of getting someone else to validate your changes and may jump start the .Net side of the project to be kept more closely in sync in future.
更多推荐
在C#程序集中引用Java DLL?
发布评论