As you've seen in this tutorial, with a few relatively minor adjustments, you can alter your original Java classes to make them accessible through the PHP Java Bridge. The modifications don't change your original classes; in fact, you've created instances of the original classes directly within PHP. That, quite simply, is the power of the PHP Java Bridge solution.
With some additional modifications—mostly changing code you originally developed in earlier parts of the same series—you have been able to create a basic PHP-based interface to your original Java classes. The result is that you have a complete interface to the Java application directly from within PHP and with a much more flexible solution than with Web services. With Web services, you had to develop the interface that provided the same functionality.
Through this series, you've taken the original Java classes and actually
changed the core elements (
SurveyQuestion and the
SurveyQuestion* classes) very little. Through
the process, you've added an interface to the database and developed a Web
service solution to enable flexible access to the original classes. The result
is a PHP-based interface to the original classes. You can use the same basic
principles here in other applications to expose existing Java classes to a
Web interface through PHP.