Akka Scala和Java之间的区别 [英] Differences between Akka Scala and Java

查看:203
本文介绍了Akka Scala和Java之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在我的一个项目中使用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之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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