3

I want to use PHP in the frontend(for UI and calling services) and java at the backend(for database interaction and creating REST services) for my web application.

I want to know the advantages and disadvantages of this kind of approach.

6
  • 3
    why not do it both in java or both in php? Commented Dec 6, 2010 at 4:21
  • 3
    Disadvantage obviously is to hire 2 kinds of skilled resources. 1 - Set of Java guys 2 - Set of PHP guys. :) Commented Dec 6, 2010 at 4:23
  • @andreas- Your answer to why: # Interpreted languages like PHP have notable better (shorter) edit/test cycles than compiled ones. This is particulary true for web frontends, which have to be tested in various conditions. # PHP ist quite robust and scalable. #Its great not to have business logic in PHP. Commented Dec 6, 2010 at 4:31
  • @pavanlimo- I am a Java developer myself and learning php wont be a very hard nut to crack for me. Is there any other disadvantage/advantage concerning performance and coding? Commented Dec 6, 2010 at 4:34
  • @Anand: I am Java developer and PHP is no-no for me. I don't like to code in PHP. Please, no offence intended, but mind is not trained for that. I tried Groovy with Grails, and its awesome. I wouldn't mind develop a real app using that. Moreover, I am learning Python and Django these days. But PHP is not my type. Commented Dec 6, 2010 at 4:38

3 Answers 3

3

If thats the case, I will strongly recommend to look at Groovy with Grails.

Assuming that the time is the main concern. By using Groovy with Grails, you can get faster development, and with all the power of Java, seamlessly.

  • Ease of development
  • Higher productivity
  • No need to have two teams one for PHP and other for Java. Java folks will get Groovy very fast
  • Get the power of popular and state-of-the-art frameworks like, Spring and Hibernate
  • Run it on JVM
  • Everything of Java is available
  • Grails unit tests

[Edited]

From your comments to the question, it seems like you are looking for some powerful web templates, as available in Joomla or Drupal CMSs.

Sign up to request clarification or add additional context in comments.

Comments

0

Ug, that sounds messy. Things like security have to either be implemented cleverly or duplicated (think form validation vs server side validation, you probably want both). Pure Java or pure PHP solutions will have things like that built in.

Next, it becomes a bit tricky to debug certain things. If you have an issues you have two logical "stacks" to sieve through.

Finally, I personally don't know of web server that runs both Java and PHP so you I bet you'll have to have two webservers which means twice the configuration and twice as many fail points.

2 Comments

i got the idea from this: palava2.org/why.html ; And yes, does anyone know if we can run both php and java on the same web hosting server?
I am 90% sure that all Java servers are J2EE only server. A quick Google search found this php-java-bridge.sourceforge.net/pjb but I don't know much about it.
0

Advantages:

  • Site could scale better in java, because PHP does not have a proper thread model.
  • Java is a strongly typed language with a lot of good IDEs to help you write code properly. It also has a very good testing framework support.

Disadvantages:

  • Two codebases(PHP and java). Can add extra complexity.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.