views:

315

answers:

4

I'm designing a web application.

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.

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.

Any thoughts on this type of implementation would be appreciated.

+1  A: 

Yes it is feasible, but why wouldn't you just develop everything in 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.

ghoppe
Agreed. OP hasn't indicated why on earth he'd want to split the site into two languages like this. If there's a compelling reason, he should say so.
ceejayoz
I've learned to mostly take these O_o questions at face value.
Will Hartung
You could answer similarly and say why wouldn't you just develop everything with Java-based technologies and not PHP? ;-)
Taylor Leese
A: 

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.

jordanstephens
PHP runs on the server too. Why split the language for the back end?
ghoppe
It's the OPs problem to deal with the "why?" I assume he has a reason, why bother him with asking him his life story? Just answer the question.
jordanstephens
The OP asked if it was feasible and for our thoughts on the implementation. The "why?" is very relevant when answering that.
ceejayoz
+1  A: 

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.

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.

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.

Pekka
A: 

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."

Will Hartung