I'm designing a web application.
我正在设计一个web应用程序。
I was wondering if it was feasible to design a php front end (using some php framework e.g. CakePHP), which stores and retrieves data to display to the user.
我想知道是否可以设计一个php前端(使用一些php框架,例如CakePHP),它存储并检索数据以显示给用户。
Then develop a java backend which listens to the database for changes, and depending on what was changed, performs some actions and updates the database.
然后开发一个java后端,它侦听数据库的更改,并根据更改的内容执行一些操作并更新数据库。
Any thoughts on this type of implementation would be appreciated.
对于这种执行的任何想法都将受到赞赏。
6 个解决方案
#1
6
Sounds difficult to handle when the need arises to interact between the outside display, and the Java business intelligence in some way. And trust me, the need will arise.
当需要在外部显示和Java业务智能之间以某种方式进行交互时,听起来很难处理。相信我,需求将会出现。
Where would you handle things like input validation for example. In Java? Then your Java instance has to talk to the PHP app all the time. In PHP? Then you'll have business logic in the PHP part, and it sounds like you don't want that.
例如,您将在哪里处理诸如输入验证之类的东西。在Java中?然后您的Java实例必须一直与PHP应用程序对话。在PHP中?然后在PHP部分中会有业务逻辑,听起来您不希望这样。
Unless you have a really, really good reason to split it like that, I would stick with one platform. It's certainly doable this way but I think it will produce a lot of unnecessary overhead.
除非你有一个非常非常好的理由来拆分它,否则我将坚持使用一个平台。这样做当然是可行的,但我认为这会产生很多不必要的开销。
#2
1
Yes it is feasible, but why wouldn't you just develop everything in php?
是的,这是可行的,但是为什么不使用php开发所有东西呢?
To be specific: why do you need a Java backend? Answering this question would be easier if we knew why you want to implement your web application this way.
具体来说:为什么需要Java后端?如果我们知道为什么要以这种方式实现web应用程序,那么回答这个问题将会更容易。
#3
0
This is totally doable. Though you won't be able to do it in some sort of virtual hosting environment, I've never seen a webhost that gives you that kind of access to the server on a virtual/shared hosting plan. but yeah, if you had your own server you could just build the front end with php/html/javascript/whatever and build a java app to run on the server and do whatever backend operations you want. no prob.
这是完全可行的。虽然您无法在某种虚拟主机环境中进行此操作,但我从未见过在虚拟/共享主机计划中提供这种访问服务器的webhost。但是,如果你有自己的服务器,你可以用php/html/javascript/随便什么构建前端,然后构建一个java应用程序在服务器上运行,做你想做的任何后端操作。没有问题。
#4
0
It would be better if the PHP front end "notified" the Java back end about changes, rather than having the Java backend simply polling the database for changes. You could simply have a Java web app end point taking notifications from the PHP code "Hey, go look at order 1234, it's new/just changed/etc."
最好是PHP前端“通知”Java后端更改,而不是让Java后端简单地轮询数据库以获取更改。您可以使用Java web应用程序的端点接收来自PHP代码的通知“嘿,去看看订单1234,它是新的/刚刚更改的/等等”。
#5
0
I hope this helps someone, facejar is a social media built in Java and PHP which uses SOAP and Javascript to communicate with each other by passing messages.
我希望这对某些人有所帮助,facejar是一个用Java和PHP构建的社交媒体,它使用SOAP和Javascript通过传递消息相互通信。
#6
-1
I have an idea, you can pack all php data in web services mode(xml)
to send to java(axis2)
server.bu
我有个主意,您可以将所有php数据打包为web服务模式(xml),以发送到java(axis2) server.bu
#1
6
Sounds difficult to handle when the need arises to interact between the outside display, and the Java business intelligence in some way. And trust me, the need will arise.
当需要在外部显示和Java业务智能之间以某种方式进行交互时,听起来很难处理。相信我,需求将会出现。
Where would you handle things like input validation for example. In Java? Then your Java instance has to talk to the PHP app all the time. In PHP? Then you'll have business logic in the PHP part, and it sounds like you don't want that.
例如,您将在哪里处理诸如输入验证之类的东西。在Java中?然后您的Java实例必须一直与PHP应用程序对话。在PHP中?然后在PHP部分中会有业务逻辑,听起来您不希望这样。
Unless you have a really, really good reason to split it like that, I would stick with one platform. It's certainly doable this way but I think it will produce a lot of unnecessary overhead.
除非你有一个非常非常好的理由来拆分它,否则我将坚持使用一个平台。这样做当然是可行的,但我认为这会产生很多不必要的开销。
#2
1
Yes it is feasible, but why wouldn't you just develop everything in php?
是的,这是可行的,但是为什么不使用php开发所有东西呢?
To be specific: why do you need a Java backend? Answering this question would be easier if we knew why you want to implement your web application this way.
具体来说:为什么需要Java后端?如果我们知道为什么要以这种方式实现web应用程序,那么回答这个问题将会更容易。
#3
0
This is totally doable. Though you won't be able to do it in some sort of virtual hosting environment, I've never seen a webhost that gives you that kind of access to the server on a virtual/shared hosting plan. but yeah, if you had your own server you could just build the front end with php/html/javascript/whatever and build a java app to run on the server and do whatever backend operations you want. no prob.
这是完全可行的。虽然您无法在某种虚拟主机环境中进行此操作,但我从未见过在虚拟/共享主机计划中提供这种访问服务器的webhost。但是,如果你有自己的服务器,你可以用php/html/javascript/随便什么构建前端,然后构建一个java应用程序在服务器上运行,做你想做的任何后端操作。没有问题。
#4
0
It would be better if the PHP front end "notified" the Java back end about changes, rather than having the Java backend simply polling the database for changes. You could simply have a Java web app end point taking notifications from the PHP code "Hey, go look at order 1234, it's new/just changed/etc."
最好是PHP前端“通知”Java后端更改,而不是让Java后端简单地轮询数据库以获取更改。您可以使用Java web应用程序的端点接收来自PHP代码的通知“嘿,去看看订单1234,它是新的/刚刚更改的/等等”。
#5
0
I hope this helps someone, facejar is a social media built in Java and PHP which uses SOAP and Javascript to communicate with each other by passing messages.
我希望这对某些人有所帮助,facejar是一个用Java和PHP构建的社交媒体,它使用SOAP和Javascript通过传递消息相互通信。
#6
-1
I have an idea, you can pack all php data in web services mode(xml)
to send to java(axis2)
server.bu
我有个主意,您可以将所有php数据打包为web服务模式(xml),以发送到java(axis2) server.bu