Flex And Php 101


Published on

Flex with PHP presentation

It's Integratiopn with Flex with PHP.


Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Flex And Php 101

  1. 1. Flex & PHP for Rich Internet Application Development Charles Bihis Software Engineer [email_address]
  2. 2. Welcome! <ul><li>Thanks for coming </li></ul><ul><li>What is a RIA? </li></ul><ul><li>Flex + PHP? </li></ul><ul><li>What can I build with it? </li></ul><ul><li>How can I build with it? </li></ul><ul><li>Demo </li></ul><ul><ul><li>REST </li></ul></ul><ul><ul><li>JSON </li></ul></ul><ul><ul><li>AMF </li></ul></ul><ul><li>Q & A </li></ul>+
  3. 3. What is a RIA? <ul><li>Rich Internet Applications </li></ul><ul><ul><li>Fully featured software package that runs in a browser </li></ul></ul><ul><ul><li>Look and feel of desktop applications </li></ul></ul><ul><ul><li>More than just Ajax on a website </li></ul></ul><ul><ul><li>Transfer the processing necessary for the user interface to the client </li></ul></ul><ul><ul><ul><li>eg. Don’t go back to the server for filtering or sorting of data </li></ul></ul></ul><ul><li>We need TWO things… </li></ul><ul><ul><li>A powerful HOST </li></ul></ul><ul><ul><li>A rich CLIENT </li></ul></ul>
  4. 4. and <ul><li>Flex </li></ul><ul><li>Client-side technology </li></ul><ul><li>Object oriented </li></ul><ul><ul><li>ActionScript 3.0 </li></ul></ul><ul><li>Flex applications are compiled </li></ul><ul><ul><li>Compile locally to SWF files for the Flash Player Runtime </li></ul></ul><ul><li>Flex Builder includes debugger </li></ul><ul><li>FREE! </li></ul><ul><ul><li>Flex SDK is free to download at Adobe Labs </li></ul></ul><ul><li>PHP </li></ul><ul><li>Server-side technology </li></ul><ul><li>Object oriented </li></ul><ul><ul><li>PHP 5 </li></ul></ul><ul><li>PHP is compiled </li></ul><ul><ul><li>Compile to bytecode for processing by the Zend Engine </li></ul></ul><ul><li>Dreamweaver does NOT include debugger </li></ul><ul><li>FREE! </li></ul><ul><ul><li>Released under PHP License and considered free by the Free Software Foundation </li></ul></ul>
  5. 5. Flex + PHP Full end-to-end solution Server (PHP) Client (Flex) <ul><li>Rich client interface handled by Flex </li></ul><ul><li>Powerful server-side data management handled by PHP </li></ul><ul><li>Easy integration between the two </li></ul>
  6. 6. PHP-Powered RIAs <ul><li>mapping application </li></ul><ul><li>http:// maps.yahoo.com </li></ul><ul><li>photo-editing application </li></ul><ul><li>http:// seespotslide.com </li></ul><ul><li>live chat application </li></ul><ul><li>http:// www.activalive.com </li></ul><ul><li>audio-editing application </li></ul><ul><li>http:// finetune.com </li></ul>
  7. 7. <ul><li>“ Rich Interactive Applications (RIA*) are at the centre of the drive to make the experience of a user’s interaction with software applications matter more.” </li></ul><ul><li>Ovum </li></ul>What’s in it for you? “ By 2010, at least 60 percent of new application development projects will include RIA technology.” Gartner $5.5 Billion
  8. 8. What’s in it for you? * PHP jobs are 30x more abundant than Flex jobs  24 000 jobs 800 000 jobs 
  9. 9. Demo
  10. 10. Demo <ul><li>Getting started </li></ul><ul><li>Simple HTML Table </li></ul><ul><ul><li>Without sorting </li></ul></ul><ul><ul><li>With sorting </li></ul></ul><ul><li>Flex + PHP using REST </li></ul><ul><li>Flex + PHP using JSON </li></ul><ul><li>Flex + PHP using AMF </li></ul><ul><li>Real-world example </li></ul>
  11. 11. Getting Started <ul><li>Have a LAMP installation up and running </li></ul><ul><ul><li>Windows: WAMP, http://www.wampserver.com/ </li></ul></ul><ul><ul><li>Mac: MAMP, http://www.mamp.info </li></ul></ul><ul><ul><li>PHP >= 5.2 required for JSON library </li></ul></ul><ul><li>Download Flex Builder: </li></ul><ul><ul><li>http://www.flex.org/download/ </li></ul></ul><ul><li>Create a MySQL database </li></ul><ul><ul><li>Name: MyDatabase </li></ul></ul><ul><ul><li>Table: Contacts </li></ul></ul><ul><ul><li>Columns: id, first_name, last_name, email </li></ul></ul><ul><li>Download AMFPHP </li></ul><ul><ul><li>http://www.amfphp.org </li></ul></ul>
  12. 12. Recap <ul><li>PHP to HTML </li></ul><ul><ul><li>Design-elements are coupled with the data </li></ul></ul><ul><ul><li>ALL processing is done on the server-side </li></ul></ul><ul><ul><li>Visually restricted by HTML style elements </li></ul></ul><ul><li>PHP to Flex </li></ul><ul><ul><li>Data handled solely by the server, whereas design handled by client </li></ul></ul><ul><ul><li>Processing is distributed accordingly </li></ul></ul><ul><ul><ul><li>Data processing handled by the server </li></ul></ul></ul><ul><ul><ul><li>Design processing handled by they client </li></ul></ul></ul><ul><ul><li>Visually rich! </li></ul></ul>
  13. 13. Flex + PHP + Flickr = Simple Rich Flickr Photo Viewer <ul><li>Accessing Flickr servers via PHP </li></ul><ul><li>Flickr returns data in serialized format </li></ul><ul><li>De-serialize in PHP </li></ul><ul><li>Output data in XML format, easily readable and accessible from Flex client </li></ul>
  14. 14. One Step Further
  15. 15. AIR + PHP + Flickr = Simple Rich Flickr Photo Viewer <ul><li>Mostly the same code as in the Flex client </li></ul><ul><ul><li>Removed custom chrome </li></ul></ul><ul><ul><li>Re-added ability to move application window </li></ul></ul>
  16. 16. Q & A
  17. 17. Tips for PHP Developers <ul><li>Make sure your PHP is working before building your Flex application </li></ul><ul><ul><li>REST (XML output) and JSON are really easy - Just call the PHP script in a browser </li></ul></ul><ul><ul><li>For AMF connections: </li></ul></ul><ul><ul><ul><li>Service Capture is an useful tool, http://kevinlangdon.com/serviceCapture/ </li></ul></ul></ul><ul><li>The Flex Debugger is your friend </li></ul><ul><ul><li>Read the help documentation and learn to use it </li></ul></ul>
  18. 18. Community Links <ul><li>Get Started with Flex and PHP </li></ul><ul><ul><li>http://www.flex.org/php/ </li></ul></ul><ul><li>Frameworks: </li></ul><ul><ul><li>Drupal Services Module: http://groups.drupal.org/services/ </li></ul></ul><ul><ul><li>Cake Framework: http://rdos.rd11.com/CakeAMFPHP/ </li></ul></ul><ul><li>AMF Implementations (all open source): </li></ul><ul><ul><li>The Midnight Coders </li></ul></ul><ul><ul><ul><li>http:// www.themidnightcoders.com </li></ul></ul></ul><ul><ul><li>AMFPHP </li></ul></ul><ul><ul><ul><li>http:// www.amfphp.org / </li></ul></ul></ul>