SlideShare a Scribd company logo
1 of 28
An Introduction to IBM WebSphere sMash for PHP Programmers       Jonathan Lawrence & Robin Fernandes Software Developers, WebSphere Development, IBM projectzero.org
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is WebSphere sMash? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is WebSphere sMash? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WebSphere sMash for the application long tail Usage Number of Applications Java Enterprise Edition For business department and mid-market customers looking for rapidly developed agile applications, short implementation cycles and ways to easily reuse existing investments. Time to value is more important than enduring value  Strategic, long-lived applications Dynamic Scripting Application Server
Accelerate business and IT alignment  Speed Simplicity Agility Dynamic scripting languages Templates & pre-built services No-charge, robust browser & Eclipse based tooling Simply create rich Web 2.0 interfaces  Application “is” the server Clean, short-lived runtime
Speed WebSphere sMash is easy for  developers  to access, learn, and use ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Simplicity WebSphere sMash makes it simple to “mash-up” services and feeds ,[object Object],[object Object],[object Object]
Agility WebSphere sMash focuses on deploying applications, not servers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Scripting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Application-centric Runtime ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modular Architecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Available Modules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
WebSphere sMash PHP Support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP in WebSphere sMash Java Virtual Machine ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],P8 Runtime Interpreter/Compiler PHP runtime Java  Extensions C Extensions XAPI-J XAPI-C PDT2 Java- Bridge JAR JAR JAR JAR Groovy runtime WebSphere sMash  HTTP server Zero Programming Model DBGp Debug
Benefits of PHP in sMash. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP – Java Bridge – Basic use <?php java_import( &quot;java.util.Date&quot; ); $date  =  new  Date( 81 ,  9 ,  12 ); echo  $date  . PHP_EOL; // prints: Sun Oct 11 00:00:00 BST 1981 java_import( &quot;java.util.HashMap&quot; ); $map  =  new  HashMap(); $map ->put( &quot;stuff&quot; ,  array ( 1 , 2 , 3 , 4 , 5 )); var_dump( $map ->get( &quot;stuff&quot; )); // prints: array(5) { ... Access Java methods and fields from PHP  <?php java_import( &quot;java.lang.System&quot; ); echo  System::currentTimeMillis(); try  { System::getProperty( FALSE ); }  catch  (JavaException  $exception ) { echo  $exception ->getMessage(); } Static methods and fields are accessible too Types are automatically converted at boundary of PHP runtime Java exceptions can be caught and handled in PHP
Java Bridge – Extending Java in PHP <?php java_import( &quot;java.io.File&quot; ); class  SubFile  extends  File { function  SuperFile( $path ) { parent ::__construct( $path ); } function  isThisCool() { return TRUE ;  // Way cool } } $file  =  new  Sub File( &quot;/&quot; ); var_dump( $file ->isDirectory()); var_dump( $file ->isThisCool()); PHP classes can extend Java classes
PHP- Java Bridge – Iterators and Overloads Signatures provide explicit control for overloaded methods <?php java_import( &quot;java.util.ArrayList&quot; ); $list  =  new  ArrayList(); $list ->add( &quot;Hello World!&quot; ); $list ->add( FALSE ); $list ->add( 1234567890 ); foreach  ( $list  as  $key  =>  $value ) { echo  &quot; $key   $value &quot; ; } Java iteration is bridged into PHP <?php java_import( &quot;java.lang.String&quot; ); $signature  =  new  JavaSignature(JAVA_INT); var_dump(String::valueOf( $signature ,  1234567890 ));
Java Bridge – More features… <?php java_import( &quot;java.math.BigDecimal&quot; , NULL,  FALSE ,  &quot;My_BigDecimal&quot; ); $value  =  new  My_BigDecimal( &quot;1.18E+10&quot; ); echo  $value ; Import a Java class under a different name to avoid clashes <?php java_import( &quot;java.lang.Comparable&quot; ); echo (ReflectionClass::export( &quot;Comparable&quot; )); PHP reflection works on Java classes <?php java_import( &quot;java.io.File&quot; ); $file  =  new  File( &quot;/home/robinf&quot; ); var_dump( $file ->Parent); //equivalent to: var_dump( $file ->getParent()); Java bean support provides field access for get/set method calls
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
Some PHP Applications that run on sMash Forums CRM wiki Desktop Virtualisation Ajax Debugging Content Management Blogging FirePHP
Features we didn’t cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Project Zero –  projectzero.org ,[object Object],[object Object],[object Object],[object Object],[object Object],Visit   http://projectzero.org Project Zero is the development and incubation community around WebSphere sMash  Come to our stand for more demos!
Legal Notices ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

108 advancedjava
108 advancedjava108 advancedjava
108 advancedjavaAnil Kumar
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingChristopher Pecoraro
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jaojedt
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UGProject Zero
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Securing Your Web Server
Securing Your Web ServerSecuring Your Web Server
Securing Your Web Servermanugoel2003
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 
Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015iScripts
 
AMF Testing Made Easy! DeepSec 2012
AMF Testing Made Easy! DeepSec 2012AMF Testing Made Easy! DeepSec 2012
AMF Testing Made Easy! DeepSec 2012Luca Carettoni
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJSBlake Newman
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationAjax Experience 2009
 
AEM - Binary less replication
AEM - Binary less replicationAEM - Binary less replication
AEM - Binary less replicationAshokkumar T A
 

What's hot (20)

Getting started with laravel
Getting started with laravelGetting started with laravel
Getting started with laravel
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routing
 
What Is Hobo ?
What Is Hobo ?What Is Hobo ?
What Is Hobo ?
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jao
 
CakePHP
CakePHPCakePHP
CakePHP
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UG
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Securing Your Web Server
Securing Your Web ServerSecuring Your Web Server
Securing Your Web Server
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Php&amp;yii2
Php&amp;yii2Php&amp;yii2
Php&amp;yii2
 
Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015Advanced PHP Web Development Tools in 2015
Advanced PHP Web Development Tools in 2015
 
Tech talk webtech
Tech talk webtechTech talk webtech
Tech talk webtech
 
Laravel Eloquent ORM
Laravel Eloquent ORMLaravel Eloquent ORM
Laravel Eloquent ORM
 
AMF Testing Made Easy! DeepSec 2012
AMF Testing Made Easy! DeepSec 2012AMF Testing Made Easy! DeepSec 2012
AMF Testing Made Easy! DeepSec 2012
 
Laravel Restful API and AngularJS
Laravel Restful API and AngularJSLaravel Restful API and AngularJS
Laravel Restful API and AngularJS
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
 
AEM - Binary less replication
AEM - Binary less replicationAEM - Binary less replication
AEM - Binary less replication
 

Similar to An Introduction to Websphere sMash for PHP Programmers

PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQLbmani
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the restgeorge.james
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Mixing Java and PHP with Sugar and WebSphere
Mixing Java and PHP with Sugar and WebSphereMixing Java and PHP with Sugar and WebSphere
Mixing Java and PHP with Sugar and WebSpherejdlea
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devsguest0a62e8
 
Survey of restful web services frameworks
Survey of restful web services frameworksSurvey of restful web services frameworks
Survey of restful web services frameworksVijay Prasad Gupta
 
Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scriptingsawsan slii
 
Everyone loves PHP
Everyone loves PHPEveryone loves PHP
Everyone loves PHPAbhijit Das
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Ido Flatow
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformSébastien Morel
 

Similar to An Introduction to Websphere sMash for PHP Programmers (20)

Lamp Zend Security
Lamp Zend SecurityLamp Zend Security
Lamp Zend Security
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the rest
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Mixing Java and PHP with Sugar and WebSphere
Mixing Java and PHP with Sugar and WebSphereMixing Java and PHP with Sugar and WebSphere
Mixing Java and PHP with Sugar and WebSphere
 
Mashups
MashupsMashups
Mashups
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devs
 
Survey of restful web services frameworks
Survey of restful web services frameworksSurvey of restful web services frameworks
Survey of restful web services frameworks
 
Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scripting
 
Everyone loves PHP
Everyone loves PHPEveryone loves PHP
Everyone loves PHP
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
php
phpphp
php
 
Lamp
LampLamp
Lamp
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

An Introduction to Websphere sMash for PHP Programmers

  • 1. An Introduction to IBM WebSphere sMash for PHP Programmers Jonathan Lawrence & Robin Fernandes Software Developers, WebSphere Development, IBM projectzero.org
  • 2.
  • 3.
  • 4.
  • 5. WebSphere sMash for the application long tail Usage Number of Applications Java Enterprise Edition For business department and mid-market customers looking for rapidly developed agile applications, short implementation cycles and ways to easily reuse existing investments. Time to value is more important than enduring value Strategic, long-lived applications Dynamic Scripting Application Server
  • 6. Accelerate business and IT alignment Speed Simplicity Agility Dynamic scripting languages Templates & pre-built services No-charge, robust browser & Eclipse based tooling Simply create rich Web 2.0 interfaces Application “is” the server Clean, short-lived runtime
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. PHP – Java Bridge – Basic use <?php java_import( &quot;java.util.Date&quot; ); $date = new Date( 81 , 9 , 12 ); echo $date . PHP_EOL; // prints: Sun Oct 11 00:00:00 BST 1981 java_import( &quot;java.util.HashMap&quot; ); $map = new HashMap(); $map ->put( &quot;stuff&quot; , array ( 1 , 2 , 3 , 4 , 5 )); var_dump( $map ->get( &quot;stuff&quot; )); // prints: array(5) { ... Access Java methods and fields from PHP <?php java_import( &quot;java.lang.System&quot; ); echo System::currentTimeMillis(); try { System::getProperty( FALSE ); } catch (JavaException $exception ) { echo $exception ->getMessage(); } Static methods and fields are accessible too Types are automatically converted at boundary of PHP runtime Java exceptions can be caught and handled in PHP
  • 20. Java Bridge – Extending Java in PHP <?php java_import( &quot;java.io.File&quot; ); class SubFile extends File { function SuperFile( $path ) { parent ::__construct( $path ); } function isThisCool() { return TRUE ; // Way cool } } $file = new Sub File( &quot;/&quot; ); var_dump( $file ->isDirectory()); var_dump( $file ->isThisCool()); PHP classes can extend Java classes
  • 21. PHP- Java Bridge – Iterators and Overloads Signatures provide explicit control for overloaded methods <?php java_import( &quot;java.util.ArrayList&quot; ); $list = new ArrayList(); $list ->add( &quot;Hello World!&quot; ); $list ->add( FALSE ); $list ->add( 1234567890 ); foreach ( $list as $key => $value ) { echo &quot; $key $value &quot; ; } Java iteration is bridged into PHP <?php java_import( &quot;java.lang.String&quot; ); $signature = new JavaSignature(JAVA_INT); var_dump(String::valueOf( $signature , 1234567890 ));
  • 22. Java Bridge – More features… <?php java_import( &quot;java.math.BigDecimal&quot; , NULL, FALSE , &quot;My_BigDecimal&quot; ); $value = new My_BigDecimal( &quot;1.18E+10&quot; ); echo $value ; Import a Java class under a different name to avoid clashes <?php java_import( &quot;java.lang.Comparable&quot; ); echo (ReflectionClass::export( &quot;Comparable&quot; )); PHP reflection works on Java classes <?php java_import( &quot;java.io.File&quot; ); $file = new File( &quot;/home/robinf&quot; ); var_dump( $file ->Parent); //equivalent to: var_dump( $file ->getParent()); Java bean support provides field access for get/set method calls
  • 23.
  • 24.
  • 25. Some PHP Applications that run on sMash Forums CRM wiki Desktop Virtualisation Ajax Debugging Content Management Blogging FirePHP
  • 26.
  • 27.
  • 28.