在 Web 应用程序的后端使用 Java中间件中的php

发布于 2024-10-11 17:03:32 字数 153 浏览 2 评论 0原文

我期待在后端使用 Java 开发社交网络应用程序(以支持 Cassandra 数据库的操作)和中间件中的php。这种做法有好处吗?上述策略有什么缺点吗?

是否有其他更好的选择来确保可扩展的架构?

编辑:你们认为完全用 JAVA (J2EE) 来做这件事怎么样?

I am looking forward to developing a social web application using Java in backend (to support operations from Cassandra database) & php in the middleware. Is this kind of approach beneficial ? Any downsides of the above strategy ?

Are there other better options to ensure a scalable architecture ?

Edit : What do you guys think about doing it completely in JAVA (J2EE)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

韵柒 2024-10-18 17:03:32

混合 PHP 和 Java 会带来一些好处:

  1. 您会失去 PHP 和 MySQL 之间紧密集成的好处,因为 Java 将位于中间(可能有很多复杂的意大利面条代码)。
  2. 在 PHP 视图和 Java 模型之间引入了一个复杂的控制器层,这可以通过利用 Spring MVC 或 Struts 2 等开源 MVC 项目轻松处理。

  3. 被介绍给的开发人员
    代码,因为他们必须学习
    两种编程语言。

我个人提倡使用 Struts 2 MVC 架构,通过 Spring 集成来处理使用 Hibernate 或 IBatis 的数据访问,或者您可能将模型层连接到的任何服务/后端。

如果您与 PHP 紧密相关,我建议您坚持使用纯 PHP 和 MySQL,因为当您寻找其他开发人员加入该项目时,您有一个完整的社区可以帮助您进行故障排除、支持和技术帮助。

Mixing PHP and Java does a few things:

  1. You lose the benefit of the tight integration between PHP and MySQL, as Java will fit in the middle (with probably lots of complex spaghetti code).
  2. You introduce a complex Controller layer between the PHP View and the Java Model, which could be easily handled by leveraging open source MVC projects such as Spring MVC or Struts 2.
  3. You create a larger barrier for new
    developers who are introduced to the
    code, since they will have to learn
    both programming languages.

I, personally, advocate the Struts 2 MVC architecture, with Spring integration to handle your data access using Hibernate or IBatis, or to whatever service/backend you may be connecting your model layer to.

If you are tied to PHP, I would suggest sticking with pure PHP and MySQL, since you have an entire community to help with troubleshooting, support, and technical help when you are looking for other developers to join the project.

鲜血染红嫁衣 2024-10-18 17:03:32

缺点是产品拥有多种编程技术,从您描述的方式来看,在您完全定义程序将如何发展和改变之前,目前只有一种技术可以满足要求,而这种技术甚至还没有开始。你认为事情今天会如何发展,而不是项目完成后会如何发展。通过创建分层/多方面的程序运行时环境,您将造成调试、扩展和开发的噩梦。开始行动,然后重新定义您的需求,看看是否需要这些极其复杂的结构。

The downside is having multiple programming technologies for a product that, from the way you described it, hasn't even started yet when a single one could fit the bill for the time being until you completely define how the program is going to evolve and change. How you think things are going to turn out today it not how they will turn out when the project is finished. By creating a tiered / multi faceted program runtime environment, you will be creating a debugging, scaling, and development nightmare. Get off the ground and then redefine your requirements to see if these massively complex structures are needed.

疯了 2024-10-18 17:03:32

我通常认为,如果您可以管理增加的复杂性,那么这是一个很好的方法。
好处是:

然后,正如杰弗里·瓦格纳(Geoffrey Wagner)指出的那样,它增加了很多复杂性,您应该非常确定您需要这种设置。

I generally think it's a good approach if you can manage the added complexity.
The benefits are:

Then again as Geoffrey Wagner pointed out, it adds a lot of complexity and you should be very sure you need this kind of setup.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文