0

I came across open-source project PHP/javaBridge for connecting php application with java. But why should I use java with php? Is there any specific advantage for this? Thanks, Robert

1
  • 4
    I came across a river. Why there is a river? Should i swim? Or just pass it by? Decisions, decisions. Life is not easy... Commented Aug 12, 2010 at 11:11

4 Answers 4

4

The main benefit is when you already have a lot of existing java libraries that you don't want to recode in PHP, but where you do want to build new applications using PHP

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

4 Comments

is there any other benefit like.. speed of execution or something, when using java?
Actually, I'd argue that it would be slower using the bridge. The reason is that for most tasks, java won't be THAT much faster. And you're going to lose a lot in the bridge (well, maybe not a lot, but I think enough to wipe out any possible performance gain for most tasks)...
Performance-wise, it would probably be slower... but if you've already spent months developing and debugging a library in java, then there's a definite speed benefit in the development/testing cycle that could be significantly more important than a few milliseconds slower execution time
Oh, I'm not saying there aren't benefits to using the bridge. I'm just saying that raw speed likely isn't one. If you have a lot of code already in Java, then use the solution that lets you re-use all (or as much as possible) of that code...
2

You may want to use a library that is in Java.

Comments

2

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.

Comments

0

Do you really need to use 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. So is Java. Pick one, and stick with it...

1 Comment

i don't really need to use java with php.. as you mentioned just looking for new ways of doing things..

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.