我正在考虑在我的一个项目中使用Akka,但是我只能使用Java。大多数材料(书籍/文章)都是Scala版本的,所以我想知道如果我使用Java,我会成为二等公民。 两者之间在功能/性能上有何重大区别?
I am considering using Akka in one of my projects, but I have to use only Java. A majority of the material (books/articles) are on Scala version, so I am wondering if I use Java I would be a second-class citizen. Are there any significant functional/performance differences between the two?
谢谢
推荐答案就Akka本身的性能而言,它将是相同的,因为您将运行相同的Akka字节码。但是,在集成方面,您将使用Java API,并且仅限于Java的语言功能。因此,就使用API而言,您将成为二等公民。但是,从功能和性能方面讲,它几乎是相同的。请记住,您的Java代码将与Scala代码以不同的方式与库进行交互。使用Scala,您可以访问Java尚不能使用的闭包和其他结构(尚未)。不过,从Java使用Akka也是一个很棒的库。...
In terms of performance of Akka itself it will be the same since you are going to be running the same Akka byte code. However in terms of integrating you will be using the Java API and be limited to the language features of Java. As such you will be a second-class citizen in terms of using the API. However in functional and performance terms it will be pretty much identical. Just keep in mind that your Java code will be interacting with the library differently from Scala code. With Scala you have access to closure and other constructs that you cant use with Java (yet). Nevertheless Akka is a great library also when used from Java....
更多推荐
Akka Scala和Java之间的区别
发布评论