Technology of the day: Bridging Java and PHP

22 May 2007 » IBM, Java, PHP, WebSphere

Last summer I put together a list of Options for using PHP with WebSphere. One of the approaches I mentioned, but didn’t elaborate on, was to use a PHP-Java bridge.

In the time since I wrote that post, and particularly in the past month, there have been several items published which demonstrate the value of this technology. I still need to delve deeper, but here’s a quick summary of what’s going on.

What it is
In essence, a PHP-Java bridge enables PHP developers to access Java code from within their applications and vice versa. The benefit is that you can reuse libraries or services deployed on one platform from code that exists in a different environment.

This differs from the standard approach of using an HTTP server front end to route individual requests for PHP scripts or J2EE applications. The PHP or Java application can instead call the other without the HTTP server’s involvement.

While you can always use Web service APIs to communicate between your applications over HTTP, PHP-Java bridges provide a method to access the external application’s API directly from the source code. As such, they are much more efficient than traditional network calls.

How it works
Implementations enable one or more of the following techniques:

  • PHP running as a Web server module calls out to a servlet running on a J2EE application server.
  • A servlet executes PHP scripts via CGI.
  • PHP calls non-J2EE Java applications.

Where to get it
There are three major projects which implement this technology in varying degrees.

Find out more
The well documented open source PHP/Java bridge appears to be the most mature technology at this point. You’ll find more information via the related links section of the project page.

IBM developerWorks has posted the first installment in a “Develop with Java and PHP technology on AIX Version 5.3” series on setting up the requisite software in a Unix environment.

There don’t seem to be many details available about the Zend Platform Java Bridge, but I’m hoping to learn more when/if Andi Gutmans posts his presentation from JavaOne that he described in this blog entry.

There’s also a “Caffeinated PHP, Integrating PHP and Java” Webinar tomorrow which will describe Zend’s offering.

I’m not sure of the roadmap for the PHP Integration Kit and it hasn’t moved much since being announced as an alphaWorks technology last year.

Introduction to databases for programmers

21 May 2007 » DB2, MySQL, PHP, Web development

Kenneth Downs from Secure Data Software will take us back to basics with his “Introduction to Databases for Programmers” at Tuesday night’s NYPHP meeting:

This May, New York PHP takes a look at a critical, yet often overlooked, aspect of web development. The database is the heart of any system, but it often gets-no-respect by application developers. Join Kenneth Downs as he leads us through the important database concepts for a successful system.

Databases work on principles that are different from programs. Best programming practices, when applied to databases, will produce bad results, and vice versa. In this talk we will look at how databases differ from code (the so-called “impedance mismatch” between code and data), see a brief introduction to normalization, find out what “ACID compliant” means, and see some triggers and stored procedures.

Thanks to IBM for providing a great presentation space with seating for plenty.

There’s still time to submit your RSVP until noon EDT Tuesday, so hop to it.

Revolutionary folk makes a comeback

18 May 2007 » Music, Politics

Salsa has long been viewed as the sound of Cuba. With the international success of the Afro-Cuban All Stars and the documentary/album Buena Vista Social Club, this genre has further overshadowed the other major movement in Cuban music: Nueva trova, which is a form of folk driven by political themes.

Silvio Rodríguez is probably the most famous of the nueva trova movement, and there were a few artists outside of Cuba that embraced the sound. “Playa Girón” by Silvio Rodríguez and “Hemos Dicho Basta” by Daniel Viglietti from Uruguay are good examples of this style.

I haven’t listened to those songs in a while, but I stumbled across a new tune from The Nightwatchman called “The Road I Must Travel.” It instantly reminded me how much I enjoyed this genre. After hearing the song on the radio, I dug into the “group” and discovered that it is none other than the solo work of Tom Morello of Rage Against the Machine and Audioslave fame.

It’s nice to see folk brought back to its roots and away from the insipid variant which has come to dominate the coffeehouse radio circuit.

Basic DB2 9 certification

17 May 2007 » DB2, IBM, System administration

I’m going to try my hand at the DB2 9 Fundamentals certification exam. Like the SCJP for Java, this exam provides an entry point to the speciality role certifications performed by folks that work with DB2. In my case, the longer term goal is to become an IBM Certified Application Developer.

OK, I’m a sucker for acronyms on the résumé, but the tangible benefits I see in this certification are similar to what I gleaned from the ZCE:

  • Reinforce base DB2 skills during the study phase.
  • Legitimate DB2 experience picked up over the years.
  • Learn the new features added to DB2 between versions 8 and 9.
  • Teach myself more about DB2 without attending a class.
  • Establish an assumed level of competency that can be used as a currency in career advancement.

It also doesn’t hurt that I was able to get a discounted exam voucher. :)

Update: I passed :)
Read about my Thoughts on the DB2 9 Fundamentals exam.