Develop and test your apps on the IBM Cloud

I moved to a new position within IBM at the beginning of the year, joining the Enterprise Initiatives organization responsible for delivering IBM Smart Business Development and Test on the IBM Cloud.

Before I joined this team, Development and Test launched as a free public beta in 2009. Throughout 2010 we’ve incrementally improved the pilot and in the near future a generally available pay-per-use version will go live.

I’ll describe some of the features that Development and Test beta has now, highlight some usage scenarios that it can enable or improve, and along the way tell you where to learn more. As always, the standard disclaimer applies.

In a future post, I may put together step-by-step instructions on using the virtual machines on the IBM Cloud to:

  • Build PHP with an instance of DB2 as a way to illustrate how system administrators can evaluate the platform or practice configuration.
  • Verify that a sample Java EE application written for Tomcat works unmodified on WebSphere.

IBM Smart Business Development and Test on the IBM Cloud
Like many Cloud technologies, Development and Test aims to reduce the time and money spent by customers to procure, configure, and run IT infrastructure, platforms and software.

But the target of this particular system is to:

  • Give developers and testers hands-on access to IBM software in minutes rather than days or weeks.
  • Provide application developers with an environment to write and run their applications.
  • Allow usage to scale up or down depending on the phase of the project.

As a result, users will have more confidence in the quality of their work and are able to make better informed choices about its hosting environment when they deploy.

Feature overview
The Development and Test beta is a Web application that provides a dashboard for managing Cloud resources, a catalog of images to start with, and a set of APIs (Web service and command line) for accessing assets programmatically.

With it, you can:

  • Provision virtual servers
    An application developer can quickly start up an instance of a server OS, such as Red Hat Enterprise Linux, that is pre-configured with WebSphere or DB2, for example.

    With an operating system and middleware in place, the developer can try out the software setup or verify that their application works on that particular configuration.

  • Set up virtual development environments
    A developer can request a fully configured IDE instance, such as the Eclipse-based Rational Software Architect, and connect to it using a virtual desktop like FreeNX.

    Alternatively, the user can integrate with a hosted instance of Rational source control, automated testing, and project management software from the physical workstation they already use.

  • Save and extend configurations
    Once the team is satisfied with the product or system at a point in time, they can save a snapshot image of the configured instance.

    That image can then be used as a template from which to create new instances that can be shared with others. Those images can also be tagged as a test release or captured as a known good savepoint to build upon.

    Beyond the catalog of pre-configured IBM software stacks in the system now, IBM is working with partners to add third-party pre-configured packages on the Cloud.

In all cases, the user acquires the resources s/he needs right away without the need to find and run hardware or download, install and configure software.

This shortens project start time, reduces time spent on configuration trial and error, allows for more development iterations in the schedule given the same project length.

If you want to get a hands on introduction now, have a look at the developerWorks overview article or user guide (PDF).

Otherwise, if you want to hear my take how I think this particular Cloud platform can make life a whole lot easier for anyone involved in software development, read on.

New possibilities
Since this approach reduces much of the time and money to get hardware and set up software, several new possibilities and potential use cases come to mind.

Imagine the following scenarios that can be made possible or made much easier:

  • You are an innovator who needs a place to demo an early prototype to potential investors in order to justify further development.
  • You are a developer who has created an application on your laptop with a Personal or Express edition of IBM software and you want to see if it will run on a WebSphere and DB2 server to see if there are unexpected differences.
  • You are an independent software vendor who has verified your software on Tomcat (or PHP) and MySQL and wants to widen your potential customer base to include those customers who have an IBM infrastructure.
  • You are a committer to an open source project, and you want to replicate an issue reported by a user and and debug it using the configuration they have on their system.
  • You are a student who wants to build skills or experience hands on or do comparative research between operating systems and software vendors.
  • You are a standards body member, such as for ODF or Java EE, and want to see how a vendor implementation adheres to the specifications.
  • You are an author, you can make sure your readers have a copy of your sample code.
  • You are an instructor, you can make sure your students have an identical setup to reduce class prerequisite setup time.
  • You are a system administrator, and you want to test out an upgrade on an identical server before committing changes that are time-consuming or difficult to reverse on your own system.

Sound interesting?
The Development and Test on the IBM Cloud beta is available to use for free right now. In the coming weeks, a paid, stable and supported version will be available that charges on a usage basis.

If you want to take it for a spin, have a look at the developerWorks overview article or user guide (PDF) in order to get started with the beta. The support page offers forums, FAQs and getting started videos.

You may also want to follow the new developerWorks section and join the user community to learn more about this platform in particular and Cloud computing in general.

If you’re interested in the upcoming paid version check out the data sheet (PDF) on the IBM Middleware Services page. This video also makes a compelling introduction.

Enjoy, and don’t forget to check back here in the coming weeks to see those step-by-step PHP/DB2 and Tomcat/WebSphere tutorials.

Upcoming WebSphere and PHP book reviews

04 December 2009 » Java, PHP, Web architecture, WebSphere, Writing, Zend

With several vacation days to cash in through the end of 2009, I hope to catch up on some reading and learn more about the latest developments in the two areas where I do most of my work as a Web application developer – Java EE Web applications built on IBM WebSphere and PHP Web applications using various Zend products.

About a month ago I performed a technical pre-publication review of the second edition of the MySQL to DB2 Conversion Guide that was just released this week, but the following books will be covered from an end user point of view, after general availability.

IBM WebSphere eXtreme Scale 6
First up will be IBM WebSphere eXtreme Scale 6 by Anthony Chaves.

Packt Publishing – who have sent me a free review copy – have made “Chapter 7: The DataGrid API” (PDF) available as a free download.

WebSphere eXtreme Scale is an in-memory data grid used to cache objects and improve both performance and scalability in Java EE applications. It’s analogous to memcached.

I’ve read the first chapter so far and am looking forward to diving into the rest shortly, particularly as I continue to tune a high-volume WebSphere application set to launch an update later this month.

Pro IBM WebSphere Application Server 7 Internals
My next review will be a related middleware title, Pro IBM WebSphere Application Server 7 Internals by Colin Renouf. Apress also sent me a review copy of this book, along with the next title.

I’ve read a few chapters so far, and am quite intrigued by how the author has exploited the modular Eclipse (didn’t know that!) underpinnings of WebSphere 7 to produce some interesting system administration plug-ins.

Of most interest to me about this book is that the author is neither an IBMer with access to WebSphere’s source code, nor writing to sell the reader on IBM middleware, but rather a seasoned pro with lots of practical experience getting the most out of WebSphere.

Zend Enterprise PHP Patterns
Finally, I’ll have a look at Zend Enterprise PHP Patterns by John Coggeshall with Morgan Tocker, also from Apress.

Rather than a catalog of architectural, object-oriented software patterns, this book describes several techniques for developing effective and efficient PHP applications using best practices based on Coggeshall’s years at Zend working on several large scale projects for enterprise customers.

I’ve read two of the chapters in this book that are of prime interest to me, “Web Application Performance and Analysis” and “Data-Caching Strategies in PHP.”

The former looks at diagnosing whether an application is CPU, memory, or I/O bound. This server level approach moves beyond profiling PHP code and looking at the hardware itself. Even for applications moving to the Cloud, this should remain extremely relevant.

The latter chapter has much in common with the WebSphere eXtreme Scale product above, so it will be interesting to learn more about the state-of-the-art in both PHP and Java EE Web application performance techniques.

So far so good
Stay tuned for the more complete reviews in the coming month or two. Right now it seems that all three titles are solid additions to any Web application developer’s library, but I’ll hold out my final verdict until I have a chance to evaluate each more thoroughly.

CommunityOne East roundup

The network is the computer… finally? It seems that Sun’s motto comes full circle, and perhaps confirms their business plan all along.

I attended Sun’s CommunityOne East in Manhattan last Wednesday and cloud was the word of the day. It was also an apt term to describe IBM’s vague overture towards the hardware/software stalwart that morning.

I didn’t walk away from the conference with specifics about the new buzzword, but I do appreciate that it captures some of what IBM has been doing, and therefore reveals a rare bit of consensus among the major vendors:

Other notes from the sessions I attended:

  • OpenESB: Connecting Enterprises: Sang Shin is an excellent instructor and firmly placed three technologies I’m evaluating for some current business needs… BPEL, WSDL, and SOAPui. Despite the compelling demo of NetBeans, I missed the actual server side / asynchronous implementation that is the promise of the ESB.
  • GlassFish v3, OSGi, Java EE 6 Preview and Tools (Eclipse, NetBeans): JEE 6 was introduced in the context of GlassFish 3. There still seems to be some work to get the standards settled any time soon for implementation in WebSphere 8. I look forward to the annotation-based and modular approach of the new standard.
  • Dynamic Languages: The Next Big Thing for the JVM or an Evolutionary Dead End? Chris Richardson reaffirmed some of my observations about Groovy… while cool, it may be the overly rebellious offspring of a middle-aged Java; Brilliant in flashes, but not quite predictable enough to bank on. Scala, however, seems to have lots of promise.

Unfortunately, I couldn’t attend Hans’ presentation on MySQL and PHP – State of the Union, but it appears to have been well received. In fact, you might expect a reprise at NYPHP’s June 23rd meeting.

IDUG India highlights

30 August 2008 » DB2, IBM, WebSphere

I just returned from two weeks in Bengaluru (Bangalore). The trip was quite productive, as I was able to work with my team on a complex Eclipse RCP/Apache Derby application in person, and solidify the two most important pillars of an extended team development effort; communication and collaboration.

Since I worked US Eastern time while in India – late afternoon to late evening weekdays – I also had a chance to attend the IDUG 2008 India Forum in the early part of the day Friday and all day Saturday.

Much like the on site face time with my development team, this conference provided an excellent opportunity to interact with DB2 experts and to put all the new Information Management technologies and products into a meaningful context.

Of particular relevance to my day job, the forum clarified where DB2 fits into the larger WebSphere, Web 2.0, and SOA picture. I was able to pick up some clever ideas for the IBM Press Room migration to DB2 9.5 next spring.

A few highlights and lessons learned from the conference:

  • Attending Curt Cotner’s keynote on the new IBM Data Studio tool and pureQuery technology. This Eclipse-based tool has a lot of potential as a standalone application development platform, or plug-in to my existing Rational Software Architect setup. Using pureQuery to improve performance and ease root cause analysis for WebSphere and DB2 apps was impressive. I also had a chance to meet Curt and chat with him briefly about PHP Web application frameworks and drivers.
  • Hearing from Leon Katsnelson about how DB2 fits into the larger SOA picture, with two very innovative case studies. One example in particular about managing volatile data in DB2 – such as currency rates and weather conditions – using a Java stored procedure to make a Web services call was very enlightening.
  • Finally getting my head around REST. The past weeks have featured a storm of misunderstanding about SOAP and RESTful Web services, sparked by a comment made by Damien Katz. Following the conversations there helped me understand the pros and cons of each philosophy, and attending a few sessions at the conference helped solidify the fundamental differences in approach to SOA.
  • Reminding myself to look into the Web 2.0 Starter Toolkit for IBM DB2. There seems to be some really cool sample applications and monitoring tools in there.
  • Getting a primer on Ruby as a language and seeing a live demo of Ruby on Rails as a framework. I’m not planning to jump ship anytime soon, but there are tons of ideas in there that can be fed back into the architectures I develop in my day job.
  • Thanks to Matthias Nicola, who was kind enough to copy his XQuery & SQL/XML cheatsheet onto a pen drive for me, I was able to play around with pureXML on my local copy of DB2.
  • Finally figuring out the difference between Data Studio and Data Studio Developer. The former is the free tool, the latter is the kit that can be licensed from IBM for a fee and includes all the cool pureQuery stuff.
  • Taking advantage of the opportunity for a free shot at the DB2 9 Application Developer exam (I passed!) and shoring up my cursor usage and trace analysis skills through some pre-test cramming.

So, all in all a great business trip and excellent conference. Kudos to the conference organizers, IDUG, and the presenters.

Instant XML feeds via the JSTL SQL tags

20 December 2007 » DB2, Java, MySQL, Web architecture, WebSphere, XML

A dusty old Java tag library can help conjure up siloed Web site data for new uses.

Some background
I’ve developed a number of server-side Java Web applications over the years, first with scriplets embedded in JSP, then with the template and tag driven paradigm offered by ATG Dynamo before the J2EE standards, and most recently with the Model-View-Controller architecture pattern in Struts and Spring MVC.

Each of those technologies (mostly) improved on its predecessor and enforced a better separation of concerns between the database, application logic, and presentation of the end result in the browser. This in turn has helped my teams divide and conquer Web application development among specialized job roles.

That’s why I’ve long been puzzled why the SQL tags in the JavaServer Pages Standard Tag Library exist as a standard part of J2EE 1.3 onward. These tags enable a front-end developer to embed SQL directly into a JSP page without the need for scriptlet code.

This tag library seemed an ill-conceived reversion (anti-pattern even) to the days before MVC took hold as a best practice in the Java world, and I’m pretty sure I skipped that section of the objectives when studying for the SCWCD exam.

That said, the SQL tags came in pretty handy this week for a particular challenge, and the more I think about how I can use them beyond their intended purpose, the more every new requirement I see looks like a nail.

My particular application context
I support a content management application which was designed, developed, and deployed circa Web 1.9. It’s stable, performant, and most importantly, met its functional requirements of the day.

In the two years that it’s been deployed, several new requirements have arisen that have expanded its anticipated scope as a traditional Web application.

In particular, the ubiquity of XML feeds have driven the need for it to present its core data outside of the templates existing in the confines of its own Web site. The rise of tagging and the popularity of multimedia as syndicatable content has also made it creak.

Compounding the architectural limitations of the application itself is its inflexible hosting environment. The data center that this site is deployed to is governed by CYA-driven restrictions (rightly so) which constitute a barrier to frequent application deployment cycles that add new functionality.

This environment makes it difficult to adopt nascent technological advances – the next big thing in “coolness” or usability – but have also kept it exceptionally stable and available to meet its codified requirements without introducing undue legal or financial risk.

The application itself consists of two subcomponents. There is a Web application module on the secured intranet for authors to generate new content, and a publicly accessible read-only Web application module to display published content.

It’s primarily this latter Internet application where the use of JSTL SQL tags comes in most handy, but I can imagine uses on the intranet side as well (ad hoc reports, for example).

The case for SQL tag driven XML feeds
The JSTL standard defines a tag library for issuing queries against a data source defined in the Web deployment descriptor without using JDBC in Java scriptlet code in a JSP.

If this sounds like a simple concept that harks back to the type 1 JSP days, that’s because it is. The documentation shows its own apprehension about the inappropriate use of these tags:

The JSTL SQL tags for accessing databases … are designed for quick prototyping and simple applications. For production applications, database operations are normally encapsulated in JavaBeans components.

But therein lies their simplicity, flexibility and power for this particular production application scenario.

In order to take any slice of your data that can be exposed via a SQL query to the authorized user mapped to the JNDI entry for that data source, all you need to do is is write your query and iterate through the result set in an XML template defined in your JSP.

Think about that outside of this technology’s intended use as a prototype or simple application building block. Instead, imagine how you could use these tags to improve the value of a complex existing production application.

For example, suppose you’ve always provided an RSS feed for your latest ten published news stories. You’ve written your Controller or Action in your chosen MVC framework of choice and deployed it.

But now your users are demanding the latest five thumbnails of images published with a story to accompany its syndicated title and abstract in their latest mashup. Or perhaps they only want to see the last 10 stories which contain a given keyword.

What do you do? You could write a new Action or Controller and proper Command class in Java to meet that requirement. That would require updating some configuration files or deploying an EAR or WAR.

But look, you have an existing deployed stable application. Why risk introducing new code or downtime to a perfectly good application? Why not just free your data for use by your users’ new requirements in a quick hitting, low risk way?

Reuse your data by plugging in new JSTL SQL tag driven JSP files, don’t rebuild your application for every new data usage requirement.

To the tag library!
Ok, so you’ve read this far. I promise, the implementation itself will be much shorter :)

So your users want more information delivered via your feeds, or they wish to query by keyword or otherwise filter your data in a way you never anticipated.

Let’s see if we can free up that data for them.

  1. Write your query, with or without input parameters.

    SELECT ID, TITLE, ABSTRACT FROM NEWS_ARTICLES;

    SELECT ID, TITLE, ABSTRACT
      FROM NEWS_ARTICLES
      WHERE BODY LIKE ‘%?%’
      FETCH FIRST 5 ROWS ONLY;

    SELECT ID, TITLE, ABSTRACT, THUMBNAIL
      FROM NEWS_ARTICLES NA, NEWS_ARTICLE_IMAGES NAI
      WHERE NA.ID = NAI.NA_ID;

  2. Determine what XML format it should be in, whether a standard such as Atom or something custom like the following.

    <?xml version="1.0" encoding="UTF-8" ?>
    <results>
      <result id="">
        <title></title>
        <abstract></abstract>
        <thumbnail></thumbnail>
        <body></body>
      </result>
    </results>
  3. Tie the query to the format in a JSP file using the JSTL SQL tag library (and optionally, the Core tag library to escape output) and the JNDI name of the data source you already have configured in web.xml.

    Consult the documentation if you want to use placeholders.

    <%@ page contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8" session="false"%>

    <?xml version="1.0" encoding="UTF-8" ?>

    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

    <sql:setDataSource dataSource="jdbc/yourdatasource"/>
    <sql:query var="items">
      SELECT ID id, TITLE title, ABSTRACT abstract, BODY body, THUMBNAIL thumbnail
        FROM NEWS_ARTICLES NA, NEWS_ARTICLE_IMAGES NAI
        WHERE NA.ID = NAI.NA_ID;
    </sql:query>

    <results>
     <c:forEach var="row" items="${items.rows}" >
      <result id="<c:out value="${row.id}"/>">
        <title><c:out value="${row.title}"/></title>
        <abstract><c:out value="${row.abstract}"/></abstract>
        <thumbnail><c:out value="${row.thumbnail}"/></thumbnail>
        <body><c:out value="${row.body}"/></body>
      </result>
     </c:forEach>
    </results>

  4. Deploy the JSP file as your application server requires. If reloading is not enabled, restart the application (consider setting a 15 minute timeout or similar, so you gain the performance boost but provide a hook for updating JSPs individually).

Conclusion
That’s it, you’ve now added an aspect of functionality to your application which frees up any data you can query for via SQL (or XQuery, if your data server is so enabled). You’ve done it in a pluggable fashion and haven’t needed to build any new Java code within your existing application and its framework.

Of course, the flip side is that you’ve done it outside of your application framework and may have circumvented some well-intended best practices. However, you may to prefer to think of this approach as a temporary, low-risk way to share the data available to the users of your application in novel ways that may justify investing in the development of longer term solutions.

Ironically enough, this reversion to single file deployment can make an application buzzword compliant with the one of the most touted recent enterprise targeted architectural pattern – SOA. It reduces the barrier between the value an application has – its data – and the consuming end point of that data – to a simple JSP.

A new ibm.com

IBM unveiled a significant upgrade to its Web site earlier this month. There were many folks who drove this successful launch and we’re all pretty proud of the result.

Beyond the aesthetic touch ups and usability improvements seen in the new v16 and v15 templates (Here’s a v14 page for comparision), there were quite a few personalization features packed in.

Visitors can now:

  • Add a given page to their interest areas based on the subject or topic indicated in the meta tags. For example, by clicking Add to My Interests.
  • Navigate based on those interests and country/language preference.
  • Sign in anywhere and share content with others via “E-mail this page” links always available in the masthead and footer.
  • Save time with forms that are pre-filled with information from their profiles when logged in.

My team’s contributions were to the client-side JavaScript and server-side Java functionality, which comprised the overall asynchronous, services-oriented architecture.

This system design enables customization to be plugged in regardless of the underlying hosting infrastructure of the existing Web site.

For example, areas of ibm.com that are hosted on static file Web servers or those which only use CGI are still able to use the new features provided by the central WebSphere application since they are enabled via a single new JavaScript file and use the id of elements in the DOM of the new HTML templates.

I had the opportunity to work with a new team and learned quite a bit over the short run of the project. I was able to pick up or improve my skills with asynchronous JavaScript programming, JSON, DOM, Java build tools such as Ant, high-performance WebSphere hosting, and the CMVC version control system.

The services-oriented architecture was probably the most fundamentally different part of this Web application from others I’ve been involved with and I’m pretty excited about applying that pattern in future projects now that I’ve seen the value of a real world implementation.

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.

Options for using PHP with WebSphere

I’m often consulted about adding PHP support to an IBM environment. Methods for connecting PHP to DB2, Informix and Cloudscape databases are covered pretty well, but it seems there’s a lot of understandable confusion about how to integrate PHP with WebSphere.

Just as you can communicate with DB2 from your PHP applications via three distinct interfaces – Unified ODBC, ibm_db2, and PDO – there are several approaches to adding PHP support to WebSphere Application Server, each with benefits and drawbacks.

As a disclaimer, I don’t claim to represent IBM or provide IBM’s viewpoints on this, but I’m offering this list as a general overview about what options are available as IBM continues to encourage the use of PHP in enterprise environments.

  • Build PHP as an Apache module and connect to WAS via the Web server plugin
    Essentially, any application server which uses an HTTP server (like Apache) on the front end can be configured as-is to support PHP, and has likely had this capability for years.

    When used in this configuration, it is only the HTTP server that needs to be configured to recognize patterns in the URL and to delegate requests accordingly. WAS and PHP know nothing of each other’s existence, but can share data via client-side cookies or a database (MySQL, DB2).

    HTTP Request
          | 
          v
    Apache / IBM HTTP Server
          |            |
          |            |	  
        .php         .wss
          |            |
          v            v
         PHP          WAS
    

    This method is described by resources listed under section 4b in the Recommended PHP reading list.

  • Use the PHP Integration Kit to add PHP support to WebSphere Application Server Community Edition
    This option is probably the most straightforward and supported by IBM, but unfortunately it doesn’t apply to regular WebSphere Application Server, only the offering provided under the WAS name built on Apache Geronimo: WAS CE.

    This method uses a servlet filter within a preconfigured Java Web application to intercept requests for PHP scripts, and calls out to PHP via CGI. I haven’t experimented with this yet, though it is appealing because all the components are free and integration is done for you. I suspect there may be a performance bottleneck by using PHP as a CGI (in contrast to as an Apache module as described above). This method is also fairly new, by virtue of being an alphaWorks offering.

  • Use the PHP / Java Bridge
    I haven’t looked into this option yet, though it appears the focus here is actual application level interaction between Java and PHP, instead of separate, mutually exclusive PHP and Java applications which share a data store and web server.

    The communication between Java and PHP in an application server like WAS or Geronimo is managed by a Java library available from SourceForge. Like the second method above, communication with PHP is done via CGI.

    I’ll post an update once I explore this option in depth. The strength here seems to be the ability to share session data. A downside is that you have to intermingle Java with PHP code and vice versa.

  • Use an implementation of a PHP interpreter in Java
    OK, this option doesn’t actually exist for WebSphere, but it may be something that IBM decides to do in the future. All speculation, of course, since I don’t work in the Software Group and have no idea what they’re up to. Personally, I *wouldn’t* like to see it happen although other JEE vendors – BEA and Caucho – have taken this path.

    In this case, some Java code has been written to interpret code written in the PHP language. What this does is move away from the PHP interpreter source code (and its extensions!) which has been written in C and replaced them with Java. The perceived benefit here is that a 100% Java library to process PHP scripts can now be included with your JEE enterprise application.

    In my opinion this doesn’t make too much sense, since in this case vendors are trying to emulate the PHP interpreter as a new code base. Because PHP is modular and relies on many third party extensions which are also built in C, this would seem a maintenance nightmare and would always lag behind the official PHP interpreter.

    The “coolness” factor of this is what BEA and Caucho are probably weighing over the practicality of it. This appears to be more of an embedded option, which may be OK for providing core PHP language support, similar to how JME is a stripped down version of Java for mobile devices.

So there are four three options. The first option seems to be the most robust and flexible, but the second is probably the easiest to set up and maintain. Explore the options for yourself, and please post any other options here that I may have missed.

Next page »