简体   繁体   English

为什么我应该在PHP中使用Java

[英]why should I use java with php

I came across open-source project PHP/javaBridge for connecting php application with java. 我遇到了用于将php应用程序与java连接的开源项目PHP / javaBridge。 But why should I use java with php? 但是我为什么要在php中使用java? Is there any specific advantage for this? 有什么特别的好处吗? Thanks, Robert 谢谢罗伯特

主要好处是,当您已经有很多现有的Java库,不想在PHP中重新编码时,却想在其中使用PHP构建新的应用程序

您可能要使用Java中的库。

You wanna find the right tool for the job, not the right job for the tool. 您想找到适合该工作的正确工具,而不是找到适合该工具的正确工作。 I guess you just shouldn't use it if you have to ask this question. 我猜如果您不得不问这个问题,您就不应该使用它。

That said, there are a few good cases where you'll use Java with PHP, most of the times the big advantage is that the Java application keeps running on the background (as a daemon) and it's more powerful. 就是说,在很多情况下,您都可以将Java与PHP结合使用,大多数时候,最大的好处就是Java应用程序始终在后台运行(作为守护程序),并且功能更强大。

Do you really need to use Java? 您真的需要使用Java吗? If so, go for it. 如果是这样,那就去吧。 Or are you just looking for new ways to do things? 还是您只是在寻找新的做事方式? If so, don't bother. 如果是这样,请不要打扰。 PHP is powerful enough to do what you need. PHP功能强大,足以满足您的需求。 So is Java. Java也是如此。 Pick one, and stick with it... 选择一个,并坚持下去...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM