Building RIA Applications in PHP John Coggeshall
Introductions • Welcome! • About me • CTO of Automotive
Computer Services (ACS) • Core PHP 5 Dev • Author, Speaker
Presentation Title
2
John Coggeshall
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
History • ACS has a single product
called a DMS (Dealer Management System) • Originally Built in DOS-
based Foxpro (1992) • Migrated to Visual Foxpro
(2004)
4
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
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
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
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
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 – when VMware behaves
• Compile/Run Flex Front-end Locally 9
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
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
Code!
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
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
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
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
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
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