选择Java或node.js的技术是什么? [英] Which technology to select Java or node.js?

查看:68
本文介绍了选择Java或node.js的技术是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将开发一个项目,它将拥有云和本地服务器,RS232和Socket通信。它是一个多页面的Web应用程序。我打算使用node.js.有人可以建议哪一个最适合我的应用程序。 Java或node.js.问题是我很了解java。

I am going to develop a project which will have cloud and local servers, RS232 and Socket communication. It is a multi-page web application. i am planning to use node.js. Can some one suggest which one is best fit for my application. Java or node.js. The thing is I know java well.

推荐答案

"It is used for front-end app"



嗯,这是非常错误的。


Well, this is horribly wrong.

"Node.js is primarily used to build network programs such as web servers, making it similar to PHP. The biggest difference between PHP and Node.js is that PHP is a blocking language, where commands execute only after the previous command has completed, while Node.js is a non-blocking language where commands execute in parallel, and use callbacks to signal completion."

https://en.wikipedia.org/wiki /Node.js [ ^ ]

node.js是一个非阻塞,单线程(事件循环),低级I / O JS(V8)解释器。 node.js的优点是它基于libuv,它是用ANSI C编写的,因此几乎可以在任何平台上编译,而不需要像Java(字节码)和.Net(IL)那样编译的VM层。本机代码和运行速度更快,内存和CPU效率更高(它通常占用更小的空间)。

所以,如果你写一个微服务(流行语警报! )去节点。



使用java的唯一理由是,它现在可以得到更好的支持和更广泛的传播。并且,有更多成熟的Java软件可以依赖 - 特别是对于钱。因此,就开发速度而言,如果您不为开发堆栈或基础架构支付费用,Java和.Net仍然是一个不错的选择。



对我来说它更像是开发速度(特别是对您而言)和运营成本之间的决定。



另外还有一件好事:Node.js有使用相同语言服务器和客户端的好处,理想情况下这称为同构JS - 查看它谷歌。虽然JAVA或.Net是可有可无的,但至少客户端,无论如何都需要JS。并且,不要忘记,它被选择成为各种公司(包括微软)的方式。目前,许多公司正在大量投资于像IBM这样最近收购了Strongloop或ebay,airbnb,linkedin,wallmart的node.js,他们正在将平台转移到节点。



但请注意:Node.js,更好的说服务器端js,与你从普通的web开发中可能知道的完全不同。



问候,我。

https://en.wikipedia.org/wiki/Node.js[^]
node.js is a non-blocking, single threaded (event loop), low level I/O JS(V8) interpreter. The advantage of node.js is that it is based on libuv, which is written in ANSI C and therefore can be compiled on nearly any platform without the need of a VM-Layer unlike Java (Bytecode) and .Net (IL) it compiles to native code and runs much faster, is more memory and cpu efficient (it has in general smaller footprint).
So, if you write a micro service(buzzword alert!) go with node.

The only good reason to use java is, that it is better supported and wider spread, for now. And, there is much more mature java software out there you can rely on - especially for money. So in terms of development speed, Java and .Net are still a good choice if you don't pay the bill for the development stack nor the infrastructure.

For me it is more a decision between development speed (especially for you) and operating costs.

One more nice thing to mention: Node.js has the benefit of using the same language server and client side, ideally this is called isomorphic JS - look it up on Google. While JAVA or .Net are dispensable, at least client side, JS is needed anyway. And, don't forget, it is chosen to be the way to go by various companies (including Microsoft). Currently many companies are heavily investing on node.js like IBM who recently bought Strongloop, or ebay, airbnb, linkedin, wallmart, who are shifting their platforms to node.

But be warned: Node.js, better to say server side js, is nothing like what you might know from ordinary web development.

regards, me.


Node.js [ ^ ]是一个基于Chrome的JavaScript运行时构建的平台,可轻松构建快速,可扩展的网络应用程序。它用于前端应用程序。要开发服务器和云,您可以使用 Hadoop [ ^ ],用Java实现。因此,您必须使用java和Node.js来开发项目。
Node.js[^] is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. It is used for front-end app. To develop server and cloud, you can use Hadoop[^], which is implemented in Java. Thus, you have to use both java and Node.js to develop your project.


这篇关于选择Java或node.js的技术是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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