Ria Applications And PHP


Published on

My talk on building rich internet applications using Adobe Flex/AIR and PHP/Zend Framework given at the PHP Quebec 2009 Conference

Published in: Technology
  • Be the first to comment

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

No notes for slide

Ria Applications And PHP

  1. John Coggeshall Building RIA Applications in PHP
  2. 2 John CoggeshallPresentation Title Introductions • Welcome! • About me • CTO of Automotive Computer Services (ACS) • Core PHP 5 Dev • Author, Speaker
  3. Agenda • Building RIA Applications! (Duh) • Specifically… • A bit of history of the project • Building RIA applications using Adobe Flex/AIR with Zend Framework • Challenges in creating RIA applications that reflect client-side applications • Demos,Technical Discussions, etc. 3
  4. History • ACS has a single product called a DMS (Dealer Management System) • Originally Built in DOS- based Foxpro (1992) • Migrated toVisual Foxpro (2004) 4
  5. History • Software runs off of a Samba share on a slackware server • Every modifies the same “local” database file • Cross-location interaction via Remote Desktop 5
  6. We’re Doomed! • Besides the obvious technical limitations of the system, our product had problems that hold up our business: • No data sharing • No ability to sell to large mega-dealerships that require data sharing • No data analytics • Data… Data… data… data…. problems 6
  7. Our Solution.. • The solution:An internet-based DMS • PHP / Zend Framework to the rescue! • One problem: Our Customers • Very fickle about technology • Were largely very happy with DOS applications • Our solution needs to really feel like a desktop application, without being one • We’re still doomed! 7
  8. We’re Saved! • Adobe AIR / Flex to the Rescue! • With Flex / AIR for the user- interface and PHP/ZF on the backend we are able to accomplish all of our goals • Flex/AIR provides the user- experience demanded by our users • PHP / ZF provide the server-side magic 8
  9. Our Development Stack • Zend Studio for Eclipse • PHP / ZF development • Adobe FlexBuilder 3 plugin for Eclipse • Front-end Development • VMWare development server • To host PHP application – whenVMware behaves • Compile/Run Flex Front-end Locally 9
  10. Server Setup • MySQL Database • Some stored procedures for complex manipulations • Multi-Protocol architecture • Supports RPC calls via “REST-ish” XML services as well as the Adobe AMF format via the Zend_Amf component of Zend Framework 10
  11. Frontend Setup • Adobe Flex and AIR runtime (duh) • Fundamentally a PureMVC-based architecture • (slowly moving away from that) • A fair amount of custom code for data-transfer over the AMF protocol • We can’t use the standard Flex RemoteObject facilities (only works with something like BlazeDS) 11
  12. Code!
  13. Not without problems • Flex and AIR work pretty well with PHP, but there are a lot of problems • Lack of Server-push technology available on the PHP side makes saving data pretty painful • Have to devise your own saving mechanisms and keep them consistent • Lack of Server-push makes collaboration painful across clients 13
  14. Hardware == Painful • As powerful as AIR is a platform, it has a serious flaw • NO support for hardware on any level means all of those bar-code scanners, driver’s license scanners, custom printers we use suddenly can’t be used • … Okay, now we’re really doomed. 14
  15. PHP^H^H^HJava!! • Of all things, Java comes to the rescue! • The Merapi project • http://www.merapiproject.net • Provides a Java “server” that runs alongside the AIR application • AIR can communicate with Merapi through a socket, serializing objects back and forth and making RPC calls • Merapi can communicate with hardware for us 15
  16. Deployment • New Problem: Deployment • AIR has great facilities for this • ANT-based build system builds AIR packages, deploys codebase on server(s) • Future: CruiseControl for CI / Testing 16
  17. Final Thoughts.. • Flex/AIR is the right tool for our job • Even though it’s NOT the right tool for our job (yet) • Offers a much more compelling user experience than we could produce with JS/HTML/CSS • Definitely not the right tool for every job • Of course, the PHP side just works™ for the most part • Questions? 17
  18. We’re Hiring! • Thank you! • Interested in working on a project like this? We’re hiring! • See our full-page ad in the conference program and visit us at the Job Fair! 18