WebSphere sMash explained

WebSphere sMash
Logo Size:300px
Developer:IBM
Discontinued:yes
Latest Release Version:1.1.1
Programming Language:Java
Genre:Application Server
License:Proprietary

WebSphere sMash was a development and runtime environment from IBM for the creation of dynamic web applications using the scripting languages Apache Groovy and PHP. It contained a PHP runtime written in Java.Project Zero was the experimental software development community in which new versions of WebSphere sMash were incubated. WebSphere sMash was withdrawn from sale in 2012, with support discontinued in 2014.[1]

WebSphere Smash integrated with Eclipse and produced REST-style services on top of Groovy or PHP.[2]

Architecture

There are a number of distinguishing aspects to the architecture of WebSphere sMash.

Event-driven programming model

WebSphere sMash uses an event-driven programming model. Applications are typically composed of a number of small modules which communicate with each other by firing events which are then caught by other handlers that have registered to catch the events. The code firing the event does not have any knowledge of the code that will handle the event. This architecture allows application to be built up from a mixture of code written using PHP, Java, Groovy or the Flow language.

Global context

Since events are stateless, a mechanism is required to share data between event handlers. This mechanism is the Global Context. The Global context functions basically as a large map of data divided up into various zones with different lifetimes, properties and persistence.

Repository management system

sMash makes use of the Ivy dependency manager. sMash applications are composed of models which can specify dependencies on other modules which may be present in a local Ivy repository or which can be fetched from a remote repository. IBM maintains a repository of useful modules at projectzero.org and dependencies can also be specified on the maven2 repository.

PHP support

The PHP support in WebSphere sMash is provided by a PHP runtime implemented in Java.[3] PHP scripts are compiled into Java bytecode which then run on the Java Virtual Machine (JVM). This is similar in concept to the approach taken by other projects such as JRuby and Jython, which run the Ruby and Python languages, respectively, against the JVM. Running on the JVM allows direct, same process calls between PHP, Java and Groovy code allowing applications to be assembled using a variety of languages.

In contrast to the approach taken by Quercus, the other JVM based PHP implementation, sMash is able to re-use existing PHP extensions from PHP.net attaching them to the Java virtual machine via the Java Native Interface (JNI) and an API layer called XAPI-C.

The runtime has a DBGp debug port allowing debug access from IDEs and debuggers which support the DBGp protocol such as the Eclipse PDT project.

The PHP runtime does not have an identity outside of sMash so it is simply referred to as the "WebSphere sMash runtime for PHP."

As of October 2008 WebSphere sMash is capable of running several well-known PHP applications on a Java Virtual Machine. These include SugarCRM,[4] phpBB,[5] WordPress[6] and MediaWiki.[7]

The PHP runtime supports close integration with the Java and Groovy languages through its Java/Groovy bridge. This allows PHP scripts to use libraries written in Java and Groovy through a lightweight and extremely fast interop layer. The Groovy bridge allows advanced features from Groovy to be accessed directly from PHP. Examples include closures and Groovy metaobjects.

See also

External links

Notes and References

  1. Web site: IBM United States Withdrawal Announcement 912-138. June 12, 2012.
  2. Web site: Project Zero Site . About Project Zero . 2008-06-23 . dead . https://web.archive.org/web/20080709040817/http://www.projectzero.org/about/ . 2008-07-09 .
  3. Web site: Project Zero PHP page . 2009-02-02 . dead . https://web.archive.org/web/20090125060455/http://www.projectzero.org/php/ . 2009-01-25 .
  4. Web site: Smash 4 Sugar . Smash4Sugar project at SugarForge . 2008-06-30.
  5. Web site: phpBB on PZ . PhpBB running on Project Zero . 2008-06-30 . dead . https://web.archive.org/web/20080807010857/http://www.projectzero.org/blog/index.php/2008/01/13/phpbb-running-on-project-zero/ . 2008-08-07 .
  6. Web site: WordPress on PZ . Try out PHP Application WordPress on sMash . 2008-10-09 . dead . https://web.archive.org/web/20081022080223/http://www.projectzero.org/blog/index.php/2008/10/02/try-out-php-application-wordpress-on-smash/ . 2008-10-22 .
  7. Web site: MediaWiki on PZ . Try out PHP Application MediaWiki on sMash . 2008-10-19 . dead . https://web.archive.org/web/20081016061816/http://www.projectzero.org/blog/index.php/2008/10/09/try-out-php-application-mediawiki-on-websphere-smash/ . 2008-10-16 .