SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
#2078
 Extending and Integrating Popular PHP Applications with
 IBM WebSphere® sMash

Rob Nicholson,     IBM Senior Technical Staff Member

                                                           © 2009 IBM Corporation
Abstract
IBM WebSphere® sMash is a platform for developing and running agile
  Web applications using scripting languages and Web 2.0 technologies
  such as RESTful Web services, JavaScript Object Notation, and Atom
  and RSS feeds. It supports the Groovy language, familiar to Java
  programmers, and PHP for access to thousands of PHP applications
  and libraries,and the huge PHP developer community. IBM
  WebSphere sMash is focused on significant improvement in time-to-
  value for Situational Applications and Mashups. Partners and
  community have found that by combining PHP applications and
  libraries with new code written in PHP or Groovy for the IBM
  WebSphere sMash platform, they can achieve significant reduction in
  development time for Situational Applications and Mashups. We cover
  an overview of the PHP support in IBM WebSphere sMash and the
  support for generating new PHP code before exploring more detailed
  scenarios demonstrating PHP Applications being extended, integrated
  and mashed up.

                                                                             2
                                                    © 2009 IBM Corporation
Agenda

•   WebSphere sMash
•   PHP in WebSphere sMash
•   PHP Applications
•   Demonstrations




                                                  3
                         © 2009 IBM Corporation
Agenda

•   WebSphere sMash
•   PHP in WebSphere sMash
•   PHP Applications
•   Demonstrations




                                                  4
                         © 2009 IBM Corporation
WebSphere sMash
Agile development of dynamic Web 2.0 based applications
                                      Introducing
                                      WebSphere sMash
                                     • Improves developer productivity
                                       and efficiency through the support
                                       of dynamic scripting languages
                                       (Groovy and PHP) on Java

                                     • Leverages Web 2.0 technologies
                                       for service invocation, service
                                       composition and data interchange

                                     • Provides visual tools for
                                       developers to build and assemble
                                       web2.0 applications


                                                                               5
                                                      © 2009 IBM Corporation
WebSphere sMash
             Dynamic scripting languages
Speed        Templates & Pre-built services


             Visual Editors
Simplicity
             Assemble style development

             Application “is” the server
Agility      Clean, short-lived runtime


                                                             6
                                    © 2009 IBM Corporation
WebSphere sMash Tooling
                                       Visual Flow Editor

                    Visual UI Editor


Dynamic Scripting
Editor




                                                                     7
                                            © 2009 IBM Corporation
Agenda

•   WebSphere sMash
•   PHP in WebSphere sMash
•   PHP Applications
•   Demonstrations




                                                  8
                         © 2009 IBM Corporation
Why PHP?
•   20M+ web domains use PHP
•   3M+ Programmers know PHP
•   Huge repository of reusable modules, snippets, extensions.
•   Easy language to learn -> Mashups
•   Language has evolved to be easy to use

Gartner (Dec 2007)                        TIOBE Programming Community Index (Sep 2008)

   • PHP Developers to grow from 3 to
      5.5 million by 2013
    • PHP Developers in Commercial or
      Corporate IT to grow from 13% to
      60% by 2013
    • “Pay special attention to
      opportunities to leverage PHP in
      combination with Java development
      efforts”


                                                                                          9
                                                                 © 2009 IBM Corporation
WebSphere sMash PHP Support
• PHP runtime built in Java.
  –To PHP.net as Jruby is to Ruby and Jython is to Python
• Compile PHP into Java bytecodes and run on a Java
  Virtual Machine.
• Powerful blending of PHP and Java code.
  –Java and PHP code run in the same process on the same
   Thread
    • No need for Inter-process communication.
  –Efficient calls between PHP, Java, Groovy on the same
   stack.
  –Pass data between Java, Groovy and PHP without
   copying.
    • Avoids serialising and passing data between processes.
  –Import Java classes as PHP Classes
    • Easy access to the many Java libraries from PHP code.

                                                                             10
                                                    © 2009 IBM Corporation
PHP in WebSphere sMash
         Java Virtual Machine
                                                               • Runs PHP 5 scripts
                                                               • Requires Java 5 SE or later.
                          HTTP server
                                                               • Extensibility via XAPI
      Zero Programming Model                                      • XAPI-C for C extensions from php.net
                                                                  • XAPI-J for Java extensions, native
                                                                     libraries invoked over JNI and Project Zero
      Java- Bridge




JAR
                                                                      interface
                     PHP runtime
JAR                                                  Groovy
                                             Debug




                                                                   • Extension language choice opaque to
                          P8 Runtime
JAR                                                  runtime
                                                                      PHP script
                      Interpreter/Compiler
JAR
                                                               • Java Bridge
                                                        xd
                                  XAPI-J
                                                          eb • Debug using via xdebug protocol using
                       XAPI-C
                                       Java
                                                            ug
                         C                                       Eclipse with PDT
                                    Extensions
                     Extensions


      WebSphere sMash
                                                                       PDT2

                                                                                                               11
                                                                                      © 2009 IBM Corporation
Benefits of PHP in sMash.
• Develop quickly by using the best tools and
  materials for the job.
  – PHP code such as smarty, SimpleXML, drupal, phpBB,
  – Java code such as Apache Lucene, POI and Eclipse BIRT
• Start simple using sMash tooling such as ZRM,
  Flow
  – Customise and extend using PHP scripts and snippets
• Unleash agile teams using Java and PHP skills.
  – Allow teams to use their full range of skills.
• Build on a solid base.
  – PHP built on the Java VM at the heart of IBM’s enterprise software stack.
       • Familiar to many enterprises.
       • Vast investment in JIT, Garbage Collector, RAS and tools.



                                                                                         12
                                                                © 2009 IBM Corporation
PHP – Java/Groovy Interaction
•PHP Java/Groovy Bridge allows PHP to:
 – Instantiate Java Classes
 – Call static and instance methods
 – Access static and instance fields
 – Extend Java Classes (not abstract)
 – Implement Java Interfaces.
 – Interact with Groovy Classes objects, Closures and Ranges



•Zero programming model allows PHP to:
 – Interact with other Modules built using Groovy, Java, PHP, Flow by:
   • Handle and fire Zero events
   • Fetch and store to the global context.




                                                                                    13
                                                           © 2009 IBM Corporation
PHP – Java Bridge – Basic use
                                  Basic access to Java
                               methods and fields - types
                              are automatically converted
                              at boundary of PHP runtime




 Static methods and fields
are accessible by using the
  built in JavaClass class


   Java exceptions can be
    caught in PHP scripts

                                                                  14
                                         © 2009 IBM Corporation
PHP- Java Bridge – Iterators and overloads
                         Bridging between PHP and Java iterators



                            Signatures provide explicit control for
                            overloaded constructors and methods




                                                                    15
                                           © 2009 IBM Corporation
Java Bridge – Importing Java Classes.


                      Importing a Java class creates a PHP
                         class that has the same shape




                                                              16
                                     © 2009 IBM Corporation
Java Bridge – Extending Java in PHP
                                   Extending a Java class inside PHP is
                                    possible but has some limitations




  Java bean access maps field
access onto get/set method calls




                                                                          17
                                                 © 2009 IBM Corporation
Groovy Bridge – Importing Scripts




                                                      18
                             © 2009 IBM Corporation
Other Groovy Bridge Features

• Method and Field Access
• Closures and Curry
  – PHP Functions can be passed to Groovy as a
    closure.




                                                            19
                                   © 2009 IBM Corporation
Invoking PHP - Events

• PHP Event Handler examples:
  – Timer
  – Custom Event
  – Flow, Security or Connection event.
  – Standard Request Event




                                                              20
                                     © 2009 IBM Corporation
Invoking PHP - Script Activity in Flow




                                                       21
                              © 2009 IBM Corporation
Agenda

•   WebSphere sMash
•   PHP in WebSphere sMash
•   PHP Applications
•   Demonstrations




                                                  22
                         © 2009 IBM Corporation
PHP Applications that run on sMash
       Forums                    Ajax
                wiki
                                 Debugging
                                           FirePHP
 CRM



                Desktop
   Content
                Virtualisation
   Management                     Blogging




                                                             23
                                    © 2009 IBM Corporation
ZSL develops Web 2.0 Assets 3x faster with
WebSphere sMash
Downloaded sMash DE from projectzero.org
Assets built in 3½ weeks
Junior web development team
   Dynamic Scripting Skills
   Web Development Focus
   Know very little about .Net and JEE
    Understand concepts and functioning of Web
   Services, but may not have built or deployed
   them.

67% reduction in time-to-market for developing Web
2.0 assets
90% less time to implement best-of-breed programs
Ability to reuse 25% of code
Out-of-the-box functionality vs. 2½ days to install
comparable software

                                                                               24
                                                      © 2009 IBM Corporation
Energy Commons Overview
www.energycommons.com
• Concept
  – Standardized, private labeled social networking
    application offering targeted at businesses,
    consumers, and inter company collaboration on
    the energy topic

• Value Proposition
  – Interconnection of parties for knowledge share
    and exchange on demand in a silo’d industry
    through shared cost model for development and
    operations

• Innovative Aspects
  – Interconnected portals through “hub and spoke”
    utilizing global reach, large ecosystem, and
    utility channel to create scale
  – Viral expansion into energy value chain
  – Incentive Finder for Data Center incentives
  – 24x7 advertisement for IBM as global innovator
    for energy and climate
                                                                               25
                                                      © 2009 IBM Corporation
Energy Commons Architecture Overview




                                                       26
                              © 2009 IBM Corporation
SugarCRM Integration scenario



                           MQ




                           MQ




                                                    27
                           © 2009 IBM Corporation
Demonstrations




                                          28
                 © 2009 IBM Corporation
Agenda

•   WebSphere sMash
•   PHP in WebSphere sMash
•   PHP Applications
•   Demonstrations




                                                  29
                         © 2009 IBM Corporation
30
© 2009 IBM Corporation
References
• WebSphere sMash site http://www.projectzero.org/

• WebSphere sMash forums http://www.projectzero.org/forum/

• Developers Guide Documentation.
  http://www.projectzero.org/documentation/

• PHP Applications that run on sMash:
 http://www.projectzero.org/blog/index.php/2008/10/29/documenting-php-applications-that-run-on-
 smash/




                                                                                                    31
                                                                           © 2009 IBM Corporation
We love your Feedback!
• Don’t forget to submit your Impact session and
  speaker feedback! Your feedback is very
  important to us, we use it to improve our
  conference for you next year.
• Go to www.impact09guide.com on a smartphone
  device or a loaner device
• From the Impact 2009 Online Conference Guide;
  –   Select Agenda
  –   Navigate to the session you want to give feedback on
  –   Select the session or speaker feedback links
  –   Submit your feedback

                                                                     32
                                            © 2009 IBM Corporation
© IBM Corporation 2009. All Rights Reserved.

The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for
informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While
efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS IS without warranty of any
kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other
materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its
suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.

References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.
Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or
other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is
intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other
results.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or
performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in
the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an
individual user will achieve results similar to those stated here.

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved.
Actual environmental costs and performance characteristics may vary by customer.

The following are trademarks of the International Business Machines Corporation in the United States and/or other countries:
ibm.com/legal/copytrade.shtmlAIX, CICS, CICSPlex, DataPower, DB2, DB2 Universal Database, i5/OS, IBM, the IBM logo, IMS/ESA, Power Systems, Lotus,
OMEGAMON, OS/390, Parallel Sysplex, pureXML, Rational, Redbooks, Sametime, SMART SOA, System z , Tivoli, WebSphere, and z/OS.

A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at ibm.com/legal/copytrade.shtml.

Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United
States, and/or other countries.
IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency which is now part of the Office of Government
Commerce
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and
Trademark Office
Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.



                                                                                                                                                       33
                                                                                                                      © 2009 IBM Corporation

Contenu connexe

Tendances

IBM - Developing portlets using Script portlet in WP 8001
IBM - Developing portlets using Script portlet in WP 8001IBM - Developing portlets using Script portlet in WP 8001
IBM - Developing portlets using Script portlet in WP 8001
Vinayak Tavargeri
 
Wc Mand Connectors2
Wc Mand Connectors2Wc Mand Connectors2
Wc Mand Connectors2
day
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
CMC Limited
 

Tendances (20)

IBM - Developing portlets using Script portlet in WP 8001
IBM - Developing portlets using Script portlet in WP 8001IBM - Developing portlets using Script portlet in WP 8001
IBM - Developing portlets using Script portlet in WP 8001
 
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
 
Zend In The Cloud
Zend In The CloudZend In The Cloud
Zend In The Cloud
 
TRWResume-10-2016
TRWResume-10-2016TRWResume-10-2016
TRWResume-10-2016
 
K soft corporate
K soft corporateK soft corporate
K soft corporate
 
Wc Mand Connectors2
Wc Mand Connectors2Wc Mand Connectors2
Wc Mand Connectors2
 
Ibm i-modernization
Ibm i-modernizationIbm i-modernization
Ibm i-modernization
 
전문가토크릴레이 1탄 html5 전망 (전종홍 박사)
전문가토크릴레이 1탄 html5 전망 (전종홍 박사)전문가토크릴레이 1탄 html5 전망 (전종홍 박사)
전문가토크릴레이 1탄 html5 전망 (전종홍 박사)
 
Crx 2.2 Deep-Dive
Crx 2.2 Deep-DiveCrx 2.2 Deep-Dive
Crx 2.2 Deep-Dive
 
Intro To Great Migrations Technology
Intro To Great Migrations TechnologyIntro To Great Migrations Technology
Intro To Great Migrations Technology
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
software programs
software programssoftware programs
software programs
 
CQ 5.4 Deep-Dive
CQ 5.4 Deep-DiveCQ 5.4 Deep-Dive
CQ 5.4 Deep-Dive
 
An Introduction to and Comparison of the Different APIs Supported by MQ
An Introduction to and Comparison of the Different APIs Supported by MQAn Introduction to and Comparison of the Different APIs Supported by MQ
An Introduction to and Comparison of the Different APIs Supported by MQ
 
Web Apps atop a Content Repository
Web Apps atop a Content RepositoryWeb Apps atop a Content Repository
Web Apps atop a Content Repository
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
OpenSlava 2013 - Dynamic Languages
OpenSlava 2013 - Dynamic LanguagesOpenSlava 2013 - Dynamic Languages
OpenSlava 2013 - Dynamic Languages
 
Optimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEMOptimizing HTML5 Sites with CQ5/WEM
Optimizing HTML5 Sites with CQ5/WEM
 
PHP in the Real World
PHP in the Real WorldPHP in the Real World
PHP in the Real World
 

Similaire à IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular PHP Applications with IBM WebSphere sMash

Web App Framework at SwapSkills vol28 EN
Web App Framework at SwapSkills vol28 ENWeb App Framework at SwapSkills vol28 EN
Web App Framework at SwapSkills vol28 EN
光一 原田
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
Mark Atwood
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
jbandi
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Spike Brehm
 
Web development meetingup
Web development meetingupWeb development meetingup
Web development meetingup
PiTechnologies
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
VMware vFabric
 
Silverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use ItSilverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use It
Venketash (Pat) Ramadass
 
Web programming by kiran and team
Web programming by kiran and teamWeb programming by kiran and team
Web programming by kiran and team
Hemanth Kumar N
 

Similaire à IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular PHP Applications with IBM WebSphere sMash (20)

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
 
Web App Framework at SwapSkills vol28 EN
Web App Framework at SwapSkills vol28 ENWeb App Framework at SwapSkills vol28 EN
Web App Framework at SwapSkills vol28 EN
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 
New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011New Ways To Engage With Tiempo 2011
New Ways To Engage With Tiempo 2011
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language Frontier
 
Web APIs, the New Language Frontier
Web APIs, the New Language FrontierWeb APIs, the New Language Frontier
Web APIs, the New Language Frontier
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
 
NetWeaver Gateway- Gateway Service Consumption
NetWeaver Gateway- Gateway Service ConsumptionNetWeaver Gateway- Gateway Service Consumption
NetWeaver Gateway- Gateway Service Consumption
 
Optaros Surf Code Camp Introduction
Optaros Surf Code Camp IntroductionOptaros Surf Code Camp Introduction
Optaros Surf Code Camp Introduction
 
JavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVMJavaOne 2012 CON3978 Scripting Languages on the JVM
JavaOne 2012 CON3978 Scripting Languages on the JVM
 
SAP NetWeaver Gateway - Introduction
SAP NetWeaver Gateway - IntroductionSAP NetWeaver Gateway - Introduction
SAP NetWeaver Gateway - Introduction
 
Web development meetingup
Web development meetingupWeb development meetingup
Web development meetingup
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
Silverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use ItSilverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use It
 
[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com
 
Web programming by kiran and team
Web programming by kiran and teamWeb programming by kiran and team
Web programming by kiran and team
 
QCon Shanghai: Trends in Application Development
QCon Shanghai: Trends in Application DevelopmentQCon Shanghai: Trends in Application Development
QCon Shanghai: Trends in Application Development
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
 

Plus de Robert Nicholson

Mq light For Guide Share Europe 2014
Mq light For Guide Share Europe 2014Mq light For Guide Share Europe 2014
Mq light For Guide Share Europe 2014
Robert Nicholson
 

Plus de Robert Nicholson (13)

IBM Cloud Integration Platform Introduction - Integration Tech Conference
IBM Cloud Integration Platform Introduction - Integration Tech ConferenceIBM Cloud Integration Platform Introduction - Integration Tech Conference
IBM Cloud Integration Platform Introduction - Integration Tech Conference
 
IBM Cloud Integration Platform High Availability - Integration Tech Conference
IBM Cloud Integration Platform High Availability - Integration Tech ConferenceIBM Cloud Integration Platform High Availability - Integration Tech Conference
IBM Cloud Integration Platform High Availability - Integration Tech Conference
 
IBM Hybrid Integration Platform
IBM Hybrid Integration PlatformIBM Hybrid Integration Platform
IBM Hybrid Integration Platform
 
IBM Interconnect 2016 - Hybrid Cloud Messaging
IBM Interconnect 2016 - Hybrid Cloud MessagingIBM Interconnect 2016 - Hybrid Cloud Messaging
IBM Interconnect 2016 - Hybrid Cloud Messaging
 
Platform as a Service - CloudFoundry and IBM Bluemix - Developer South Coast
Platform as a Service - CloudFoundry and IBM Bluemix - Developer South CoastPlatform as a Service - CloudFoundry and IBM Bluemix - Developer South Coast
Platform as a Service - CloudFoundry and IBM Bluemix - Developer South Coast
 
Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introducing MQ Light - IBM Interconnect 2015 session AME4181
 
MQ Light in IBM MQ: IBM Interconnect 2015 session AME4182
MQ Light in IBM MQ:  IBM Interconnect 2015 session AME4182MQ Light in IBM MQ:  IBM Interconnect 2015 session AME4182
MQ Light in IBM MQ: IBM Interconnect 2015 session AME4182
 
MQ Light for Bluemix - IBM Interconnect 2015 session AME4183
MQ Light for Bluemix - IBM Interconnect 2015 session AME4183MQ Light for Bluemix - IBM Interconnect 2015 session AME4183
MQ Light for Bluemix - IBM Interconnect 2015 session AME4183
 
Mq light For Guide Share Europe 2014
Mq light For Guide Share Europe 2014Mq light For Guide Share Europe 2014
Mq light For Guide Share Europe 2014
 
MQ Light for WTU
 MQ Light for WTU MQ Light for WTU
MQ Light for WTU
 
Messaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM BluemixMessaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM Bluemix
 
Session 1897 messaging in the cloud with elastic mq mq light and bluemix-impa...
Session 1897 messaging in the cloud with elastic mq mq light and bluemix-impa...Session 1897 messaging in the cloud with elastic mq mq light and bluemix-impa...
Session 1897 messaging in the cloud with elastic mq mq light and bluemix-impa...
 
IBM IMPACT 2009 Session 3100 - Dynamic Scripting and Rich Web 2.0 Interfaces ...
IBM IMPACT 2009 Session 3100 - Dynamic Scripting and Rich Web 2.0 Interfaces ...IBM IMPACT 2009 Session 3100 - Dynamic Scripting and Rich Web 2.0 Interfaces ...
IBM IMPACT 2009 Session 3100 - Dynamic Scripting and Rich Web 2.0 Interfaces ...
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular PHP Applications with IBM WebSphere sMash

  • 1. #2078 Extending and Integrating Popular PHP Applications with IBM WebSphere® sMash Rob Nicholson, IBM Senior Technical Staff Member © 2009 IBM Corporation
  • 2. Abstract IBM WebSphere® sMash is a platform for developing and running agile Web applications using scripting languages and Web 2.0 technologies such as RESTful Web services, JavaScript Object Notation, and Atom and RSS feeds. It supports the Groovy language, familiar to Java programmers, and PHP for access to thousands of PHP applications and libraries,and the huge PHP developer community. IBM WebSphere sMash is focused on significant improvement in time-to- value for Situational Applications and Mashups. Partners and community have found that by combining PHP applications and libraries with new code written in PHP or Groovy for the IBM WebSphere sMash platform, they can achieve significant reduction in development time for Situational Applications and Mashups. We cover an overview of the PHP support in IBM WebSphere sMash and the support for generating new PHP code before exploring more detailed scenarios demonstrating PHP Applications being extended, integrated and mashed up. 2 © 2009 IBM Corporation
  • 3. Agenda • WebSphere sMash • PHP in WebSphere sMash • PHP Applications • Demonstrations 3 © 2009 IBM Corporation
  • 4. Agenda • WebSphere sMash • PHP in WebSphere sMash • PHP Applications • Demonstrations 4 © 2009 IBM Corporation
  • 5. WebSphere sMash Agile development of dynamic Web 2.0 based applications Introducing WebSphere sMash • Improves developer productivity and efficiency through the support of dynamic scripting languages (Groovy and PHP) on Java • Leverages Web 2.0 technologies for service invocation, service composition and data interchange • Provides visual tools for developers to build and assemble web2.0 applications 5 © 2009 IBM Corporation
  • 6. WebSphere sMash Dynamic scripting languages Speed Templates & Pre-built services Visual Editors Simplicity Assemble style development Application “is” the server Agility Clean, short-lived runtime 6 © 2009 IBM Corporation
  • 7. WebSphere sMash Tooling Visual Flow Editor Visual UI Editor Dynamic Scripting Editor 7 © 2009 IBM Corporation
  • 8. Agenda • WebSphere sMash • PHP in WebSphere sMash • PHP Applications • Demonstrations 8 © 2009 IBM Corporation
  • 9. Why PHP? • 20M+ web domains use PHP • 3M+ Programmers know PHP • Huge repository of reusable modules, snippets, extensions. • Easy language to learn -> Mashups • Language has evolved to be easy to use Gartner (Dec 2007) TIOBE Programming Community Index (Sep 2008) • PHP Developers to grow from 3 to 5.5 million by 2013 • PHP Developers in Commercial or Corporate IT to grow from 13% to 60% by 2013 • “Pay special attention to opportunities to leverage PHP in combination with Java development efforts” 9 © 2009 IBM Corporation
  • 10. WebSphere sMash PHP Support • PHP runtime built in Java. –To PHP.net as Jruby is to Ruby and Jython is to Python • Compile PHP into Java bytecodes and run on a Java Virtual Machine. • Powerful blending of PHP and Java code. –Java and PHP code run in the same process on the same Thread • No need for Inter-process communication. –Efficient calls between PHP, Java, Groovy on the same stack. –Pass data between Java, Groovy and PHP without copying. • Avoids serialising and passing data between processes. –Import Java classes as PHP Classes • Easy access to the many Java libraries from PHP code. 10 © 2009 IBM Corporation
  • 11. PHP in WebSphere sMash Java Virtual Machine • Runs PHP 5 scripts • Requires Java 5 SE or later. HTTP server • Extensibility via XAPI Zero Programming Model • XAPI-C for C extensions from php.net • XAPI-J for Java extensions, native libraries invoked over JNI and Project Zero Java- Bridge JAR interface PHP runtime JAR Groovy Debug • Extension language choice opaque to P8 Runtime JAR runtime PHP script Interpreter/Compiler JAR • Java Bridge xd XAPI-J eb • Debug using via xdebug protocol using XAPI-C Java ug C Eclipse with PDT Extensions Extensions WebSphere sMash PDT2 11 © 2009 IBM Corporation
  • 12. Benefits of PHP in sMash. • Develop quickly by using the best tools and materials for the job. – PHP code such as smarty, SimpleXML, drupal, phpBB, – Java code such as Apache Lucene, POI and Eclipse BIRT • Start simple using sMash tooling such as ZRM, Flow – Customise and extend using PHP scripts and snippets • Unleash agile teams using Java and PHP skills. – Allow teams to use their full range of skills. • Build on a solid base. – PHP built on the Java VM at the heart of IBM’s enterprise software stack. • Familiar to many enterprises. • Vast investment in JIT, Garbage Collector, RAS and tools. 12 © 2009 IBM Corporation
  • 13. PHP – Java/Groovy Interaction •PHP Java/Groovy Bridge allows PHP to: – Instantiate Java Classes – Call static and instance methods – Access static and instance fields – Extend Java Classes (not abstract) – Implement Java Interfaces. – Interact with Groovy Classes objects, Closures and Ranges •Zero programming model allows PHP to: – Interact with other Modules built using Groovy, Java, PHP, Flow by: • Handle and fire Zero events • Fetch and store to the global context. 13 © 2009 IBM Corporation
  • 14. PHP – Java Bridge – Basic use Basic access to Java methods and fields - types are automatically converted at boundary of PHP runtime Static methods and fields are accessible by using the built in JavaClass class Java exceptions can be caught in PHP scripts 14 © 2009 IBM Corporation
  • 15. PHP- Java Bridge – Iterators and overloads Bridging between PHP and Java iterators Signatures provide explicit control for overloaded constructors and methods 15 © 2009 IBM Corporation
  • 16. Java Bridge – Importing Java Classes. Importing a Java class creates a PHP class that has the same shape 16 © 2009 IBM Corporation
  • 17. Java Bridge – Extending Java in PHP Extending a Java class inside PHP is possible but has some limitations Java bean access maps field access onto get/set method calls 17 © 2009 IBM Corporation
  • 18. Groovy Bridge – Importing Scripts 18 © 2009 IBM Corporation
  • 19. Other Groovy Bridge Features • Method and Field Access • Closures and Curry – PHP Functions can be passed to Groovy as a closure. 19 © 2009 IBM Corporation
  • 20. Invoking PHP - Events • PHP Event Handler examples: – Timer – Custom Event – Flow, Security or Connection event. – Standard Request Event 20 © 2009 IBM Corporation
  • 21. Invoking PHP - Script Activity in Flow 21 © 2009 IBM Corporation
  • 22. Agenda • WebSphere sMash • PHP in WebSphere sMash • PHP Applications • Demonstrations 22 © 2009 IBM Corporation
  • 23. PHP Applications that run on sMash Forums Ajax wiki Debugging FirePHP CRM Desktop Content Virtualisation Management Blogging 23 © 2009 IBM Corporation
  • 24. ZSL develops Web 2.0 Assets 3x faster with WebSphere sMash Downloaded sMash DE from projectzero.org Assets built in 3½ weeks Junior web development team Dynamic Scripting Skills Web Development Focus Know very little about .Net and JEE Understand concepts and functioning of Web Services, but may not have built or deployed them. 67% reduction in time-to-market for developing Web 2.0 assets 90% less time to implement best-of-breed programs Ability to reuse 25% of code Out-of-the-box functionality vs. 2½ days to install comparable software 24 © 2009 IBM Corporation
  • 25. Energy Commons Overview www.energycommons.com • Concept – Standardized, private labeled social networking application offering targeted at businesses, consumers, and inter company collaboration on the energy topic • Value Proposition – Interconnection of parties for knowledge share and exchange on demand in a silo’d industry through shared cost model for development and operations • Innovative Aspects – Interconnected portals through “hub and spoke” utilizing global reach, large ecosystem, and utility channel to create scale – Viral expansion into energy value chain – Incentive Finder for Data Center incentives – 24x7 advertisement for IBM as global innovator for energy and climate 25 © 2009 IBM Corporation
  • 26. Energy Commons Architecture Overview 26 © 2009 IBM Corporation
  • 27. SugarCRM Integration scenario MQ MQ 27 © 2009 IBM Corporation
  • 28. Demonstrations 28 © 2009 IBM Corporation
  • 29. Agenda • WebSphere sMash • PHP in WebSphere sMash • PHP Applications • Demonstrations 29 © 2009 IBM Corporation
  • 30. 30 © 2009 IBM Corporation
  • 31. References • WebSphere sMash site http://www.projectzero.org/ • WebSphere sMash forums http://www.projectzero.org/forum/ • Developers Guide Documentation. http://www.projectzero.org/documentation/ • PHP Applications that run on sMash: http://www.projectzero.org/blog/index.php/2008/10/29/documenting-php-applications-that-run-on- smash/ 31 © 2009 IBM Corporation
  • 32. We love your Feedback! • Don’t forget to submit your Impact session and speaker feedback! Your feedback is very important to us, we use it to improve our conference for you next year. • Go to www.impact09guide.com on a smartphone device or a loaner device • From the Impact 2009 Online Conference Guide; – Select Agenda – Navigate to the session you want to give feedback on – Select the session or speaker feedback links – Submit your feedback 32 © 2009 IBM Corporation
  • 33. © IBM Corporation 2009. All Rights Reserved. The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here. All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. The following are trademarks of the International Business Machines Corporation in the United States and/or other countries: ibm.com/legal/copytrade.shtmlAIX, CICS, CICSPlex, DataPower, DB2, DB2 Universal Database, i5/OS, IBM, the IBM logo, IMS/ESA, Power Systems, Lotus, OMEGAMON, OS/390, Parallel Sysplex, pureXML, Rational, Redbooks, Sametime, SMART SOA, System z , Tivoli, WebSphere, and z/OS. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at ibm.com/legal/copytrade.shtml. Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency which is now part of the Office of Government Commerce Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both. ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the U.S. Patent and Trademark Office Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. 33 © 2009 IBM Corporation

Notes de l'éditeur

  1. <number>
  2. <number>
  3. <number>
  4. Java Virtual Machine based runtime supporting PHP and Groovy.NOT a Java EE environmentTargeted at Script developersNot for producing Java code.A Commercial ProjectWith development done in the open and limited no-cost use.A Full Stack RuntimeWith a HTTP server, module system and simple IDE built in.IBM’s Scripting platform.For building Agile Web ApplicationsUsing PHP and GroovyUsing assets from PHP and Java worlds.Built on Java (SE not EE)Uses many LAMP principles.Single threaded application programming model.Shared nothing.Restart-able runtime.
  5. WebSphere sMash core values are Speed, Simplicity, and Agility- product elements that support this are:SpeedDynamic scripting languages (PHP and Groovy – with Java as system language)Core application constructs: templates, pre-built servicesSimplicityBuilt-In development tooling: Visual Editors for Web Page Construction and for Flow AssemblyAssemble-style development (Developers can visually mash up services and feeds using a Visual Editor for Flow Assembly)AgilitySimple deployment (application “is” the server)Runtime Characteristics (clean, cost effective, short-lived)
  6. Dynamic Scripting Editor – Groovy / PHPVisual UI Editor - Constructing web pages (Javascript)Visual Assembly Editor - Scripting / assembling activities into a flow<number>
  7. <number>
  8. Why is IBM interested in PHP? 3 Reasons: Community, Assets, SimplicityCommunity: The PHP community is around 3M programmers. (Java community is around 7M programmers). Assets: Lots of applications and snippets that can be easily re-used. Validated by sMash partners ZSL, SugarCRM.Simplicity: The language is very easy to learn even for people without traditional programming skills.But don’t be fooled. PHP is not a toy language. 1/3 of the internet uses it. It powers Yahoo, facebook and wikipedia and commercial applications such as SugarCRM.
  9. OK, so PHP is interesting…..but why not use the existing C based implementation. Why implement it on the JVM?Well, we wanted to be able to build sMash using Java but give PHP programmers a first rate programming experience.Since the PHP is built on the JVM, PHP , Groovy and Java can interact without costly IPC. Interaction on the same callstack.PHP can reach into the Global context without copying.This allows PHP programmers to leverage the power of the Java libraries and Java/Groovy programmers to re-use all the great applications and snippets from the PHP world.It really is the best of both worlds. We have multiple cases of business partners combining PHP assets with new code written in Groovy.We have instances of business partners mixing Java and Groovy programmers on the same project.Its about getting the job done…….fast……using what you have.Add to this all the great Java technology which we’ve invested 100s of PY in. Its pretty exciting to think about the Java JIT being able to chew on PHP code.IBM is not alone in this. At Javaone this year there were multiple presentations on the merits of bringing new languages to the Java Platform. Jruby, Jython, Groovy, Scala are just a few of the languages with large followings.11
  10. The PHP runtime is built on the JVM. It requires Java 5 SE or later from any vendor.The HTTP interface is via Zero. We are not using apache or lightppd here.PHP Scripts are parsed into an intermediate form and then either interpreted or compiled to Java Bytecodes.Java Bytecodes are cached in memory and written to disk as .class files.User experience is one of scripting (compilation is hidden from user).PHP extensions implemented in C from php.net can be attached via XAPI-C which uses JNI.We also attach Java extensions using XAPI-J which is how we interface to Zero and to databases via JDBC.We have a debug port to allow Eclipse PDT to debug PHP scripts.IF anyone asks about performance (suggest not to bring this up)…….PHP performance is great for most sMash use cases. The pathlength is not in the PHP its in the database, webserver and infrastructure.For huge deployments of PHP applications where out and out throughput matters, PHP performance is about 50% of PHP.net default configuration.Its important to say “default configuration” because PHP.net users can download and install a bytecode cache with improves throughput by about 4X.The implementation we have in sMash 1.1 has 2X the pure interpreter thoughout from sMash 1.0.Its still mainly an interpreter. We have designs and work items for sMash 2.0 and beyond to generate much more efficient bytecodes.
  11. OK, so what does this PHP to java interaction look like?Well there are really two schemes. For tight coupling we can use the java bridge which allows PHP to instantiate classes, call methods, extend java classes etc.This is appropriate when wanting to re-use java libraries, such as SugarCRM’s desire to use Apache libraries from their PHP application.Also one can leverage the Zero programming models to design handlers that interact using events and the Global Context.This more appropriate for ZSL’s use case where they want to mix PHP code with new handlers written in Groovy.There is also the extension interface we saw earlier of course. This allows the creation of PHP extension functions and object proxies in Java.
  12. <number>
  13. <number><number>
  14. How long implementation may takeHow many resourcesRolesHardware/software requirementsTypical project plan; first step; milestonesPitfalls; exception plan<number>
  15. <number>
  16. <number>
  17. <number>Change and Release Management for Software Development<number>
  18. http://www.ibm.com/developerworks/offers/techbriefings/<number>