Working with Doctrine 1.x, Zend Framework, and Flex
Later Update: If you are looking for an article rather on Doctrine 2 than Doctrine 1, then check this one.
This year I finally had the time to play with Doctrine (version 1.x) and Flex. Actually, it was more than playing; I’m using it for a real project that hopefully will enter production pretty soon. To summarize the experience in just a few words: it’s mind-blowing.
OK, I admit I may be exaggerating a little bit. Still, it is something that can change the way you build projects. Doctrine is an ORM (Object Relational Mapper) framework for PHP and it can really speed up the server side development when you have a lot of tables in your database.
In this article, I explore how to work with Doctrine on the server side, Flex on the client side, and remoting to communicate between Flex and PHP (using the Zend Framework for remoting on the PHP side). I also want to share with you some tools and workflows that can save you some time. While most things are fairly straightforward there are a number of tips and tricks that you may find useful if you decide to go down this road. (I will show you how to use plain vanilla value objects and how to handle dates just to give you two examples. Why reinvent the wheel?)
The application I’m going to build in this article is simple but the workflow is the same one I used with a much more complex application. Having said that let’s start by understanding the big picture.
Network Monitor feature from Flash Builder 4 Premium
Network Monitor is a new feature available only in Flash Builder 4 Premium. Basically it helps you to see what is happening when you run your Flex project and you request data using services such as RemoteObject, HTTPService, WebService etc. You can inspect the request and response body, and you can see how long it takes for a particular request to be answered. I think these capabilities are pretty useful for determining performances issues or bugs.
I wrongly assumed that Network Monitor will work only for services created using DCD wizards. Actually it works for all services, it doesn’t matter how you’ve created them.Here is a screenshot with Network Monitor and a project that uses RemoteObjects to connect to a PHP server:
There is another feature called Test Operation that allows you to ahhh, test an operation :D. This feature only works with DCD generated services.
New book on Flex 4: Flex 4 Fun by Chet Haase
Chet Haase (an engineer on the Flex SDK team) has published a book on Flex 4 called “Flex 4 Fun”. If you know anything about Chet’s passion for graphics you won’t be surprised to find chapters on graphics, filters, states, transitions, component skinning, and animations.

You can get a taste of the book itself by reading this excerpts: Pixel Bender with Flex 4 or states and components. You can buy the book from here and you can see the content and the application examples here.
Enjoy!
Developing for Android using the Flash Platform
I’ve been doing web and desktop development for the past ten years. However, I have never done any application for mobiles. There were couple of things stopping me from developing for mobile devices:
- The only technology that I could leverage from my previous experience was Java.
- While I believe that I’m doing a good job as a developer, my user experience design skills are below zero Kelvin degree, if you know what I mean. And I know how hard is to get the right UI for a desktop app. A mobile app takes it to a whole new level.
However these things are going to change. At least for some mobile platforms such as Android. We, at Adobe, are working harder than ever to make Flash Player 10.1 and Adobe AIR first class citizens on Android devices. As the number of Android phones grows it is becoming an interesting market for people who want to make money on mobile apps. And it seems the market wants all sort of apps: casual games, enterprise apps, social apps, and so on.
Once the Flash Platform is available on Android phones I’m ready to build my first mobile application. With all the expressiveness of the platform I might be able to build a great user experience (here I’m in denial of course). Actually, I’ve been working on a mobile app with my friend and colleague Tudor Muscalu (UXD at Adobe) for the past two months. And his experience helped me to design the screens and workflows. At this point I haven’t written a single line of code all that we’ve done are mock-ups.
There is something else I want to share with you regarding developing for mobiles: it really grows on me the excitement I felt when I created my first app many years ago.
If you want to know when Flash Player 10.1 becomes available for Android click here, and for AIR on Android click here.
Are you ready for your first mobile application created with the Flash Platform?
BlazeDS 4 and LCDS 3.1 are out
We’ve just made available the bits for BlazeDS 4 and LiveCycle Data Services 3.1. You can find BlazeDS here and LCDS 3.1 here.
In addition to alignment with Flex 4 and Flash Builder 4, we fixed a lot of bugs and added new features like:
- improved offline data management support
- wider platform support
You can find more on the LCDS 3.1 product page. Enjoy!
About Technology and Disasters
From time to time nature shows us that we are not as almighty as we might think. Consider, for example, the recent volcanic ash clouds that plague air flights across Europe.
These two things usually don’t mix well together. Although one could argue that some disasters happen because of technology, I think usually disasters are outside of our control. But only when a big one is happening do we come to realize how dependent we are on all the shiny things that mankind has been inventing mostly in the past 100 years.
What if there were no flights across Europe for three months? What if the complex network that provides communications were to break down for a month? Could we function in such a disruptive event? And how well would we cope with it?
While the economic losses would probably be huge, I think some good could come from such an event. Without all these networks we would probably talk more with the ones around us. Like really talk.
I mean, could you imagine Socrates doing his work today? Forging wisdom into 140 characters to accommodate Twitter or having a Facebook account to keep in touch with Crito and the others.
On the same note I was talking to a friend about the prospects that we as programmers, have in the event of a really big disaster. No computers, no networks. And we still need to make a livingt? So here you go to find something to work:
– So what do you know to do?
– I’m a programmer!
– Right! Can you “program” this cow to give more milk? Or perhaps you could “program” this hammer?
– ?!
Indeed we would be in deep something :D
I guess it is uber cool to be head down in the IT field. But on the other hand we don’t have to lose sight of why we are doing this.
What do you think?
PS. Like many people who needed to travel in Europe and couldn’t, I had to cancel my session I was about to do in the Netherlands. So this is happening when I’m not working on Saturday just blogging on something other than RIA :)
MAX 2010: Call for Speakers
The time has passed at warp speed and MAX 2010 is closing in. It’s only natural to open the Call for Speakers. So why do you wait? Just go here and claim your spot for glory! The call for speakers will close on May 3rd.

Later Update: Almost forgot to tell you: this year my fellow evangelist Ryan Stewart is the man in charge of the content. Because he’s all smiles, please guys, submit a lot of content! Let’s give him a run for the money :) And if you want to see more topics on Flex and PHP, we definitely have the man inside :D
Flex Camp in Cluj-Napoca
On April 19th, Transylvania Flex User Group from Cluj-Napoca, Romania will have a Flex Camp. If you are interested you can read more here and you can register here.
Installing Flash Builder 4 and Zend Studio 7.1 together on Mac
If you read my blog you know that one of my favorites setups is Flash Builder and Zend Studio installed together on the same Eclipse instance. This is something that you can easily achieve: install Zend Studio and then grab the plug-in version of Flash Builder and start the installer. At some point you can choose the Eclipse installation you want to use (in this case you’ll point to Zend Studio) and you are done.
However, on Mac there’s a catch: for now Flash Builder 4 is available in only a carbon based version while Zend Studio 7.1 is only cocoa based. And these two versions can not be mixed together (we are working on a cocoa version).
Fortunately there is a workaround. My friend, Roy Ganor from Zend, told me you can use the update URL and this way you’ll be able to install the Zend Studio on top of the Flash Builder 4. The update URL is this: http://downloads.zend.com/studio-eclipse/updates/7_1.

Basically, all you have to do is to open Help > Install New Software… click the Add button to add the Zend update site and then click OK. Next you select this newly added site from the combo-box and follow the wizard. Unfortunately, on the last step you may encounter an error like this:
Cannot complete the install because of a conflicting dependency.
Software being installed: Zend Studio Patches Feature 7.1.0.v20091227 (com.zend.php.patches.feature.group 7.1.0.v20091227)
Software currently installed: Eclipse Web Developer Tools 3.1.1.v200908120400-7R77FStEVw2z07WtDz-OZrhL5C-3 (org.eclipse.wst.web_ui.feature.feature.group 3.1.1.v200908120400-7R77FStEVw2z07WtDz-OZrhL5C-3)
Only one of the following can be installed at once:
JavaScript Development Tools Core 1.0.201.v200908101420 (org.eclipse.wst.jsdt.core 1.0.201.v200908101420)
JavaScript Development Tools Core 1.0.201.v2010012803 (org.eclipse.wst.jsdt.core 1.0.201.v2010012803)
Cannot satisfy dependency:
From: Zend Studio Patches Feature 7.1.0.v20091227 (com.zend.php.patches.feature.group 7.1.0.v20091227)
To: org.eclipse.wst.web_core.feature.patch.feature.group [3.1.1.v20091227]
Cannot satisfy dependency:
From: JavaScript Developer Tools 1.1.2.v200908101420-77-FGCCcNBC-BhLcE_Pm (org.eclipse.wst.jsdt.feature.feature.group 1.1.2.v200908101420-77-FGCCcNBC-BhLcE_Pm)
To: org.eclipse.wst.jsdt.core [1.0.201.v200908101420]
Cannot satisfy dependency:
From: JavaScript Developer Tools 1.1.2.v200908101420-77-FGDCcNBDjBXMoBbFb (org.eclipse.wst.jsdt.feature.feature.group 1.1.2.v200908101420-77-FGDCcNBDjBXMoBbFb)
To: org.eclipse.wst.jsdt.core [1.0.201.v2010012803]
Cannot satisfy dependency:
From: WST Web Core 3.1.1.v200908120400-7H77FDAAT7oGlfz0dFV3j0BgbCD7 (org.eclipse.wst.web_core.feature.feature.group 3.1.1.v200908120400-7H77FDAAT7oGlfz0dFV3j0BgbCD7)
To: org.eclipse.wst.jsdt.feature.feature.group [1.1.2.v200908101420-77-FGCCcNBC-BhLcE_Pm]
Cannot satisfy dependency:
From: WST Web Core Patch 3.1.1.v20091227 (org.eclipse.wst.web_core.feature.patch.feature.group 3.1.1.v20091227)
To: org.eclipse.wst.web_core.feature.feature.group [3.1.1.v200908120400-7H77FDAAT7oGlfz0dFV3j0BgbCD7]
Cannot satisfy dependency:
From: Eclipse Web Developer Tools 3.1.1.v200908120400-7R77FStEVw2z07WtDz-OZrhL5C-3 (org.eclipse.wst.web_ui.feature.feature.group 3.1.1.v200908120400-7R77FStEVw2z07WtDz-OZrhL5C-3)
To: org.eclipse.wst.jsdt.feature.feature.group [1.1.2.v200908101420-77-FGDCcNBDjBXMoBbFb]
I got around this error by following these steps:
- install the Zend Studio 7.1.x
- create a folder somewhere on your hard drive and inside of it a new folder named eclipse
- grab the features and plugins folders from the Zend Studio installation folder and copy them to the eclipse folder you’ve created earlier
- go back to your Flash Builder 4 installation folder and inside the dropins folder create a file called emf.link. Add in the emf.link file this line: path=/Users/mcorlan/Documents/work/zend_studio_7.1_plugin – this folder contains the eclipse folder with features and plugins folders (make sure you edit the path according to where you placed the Zend Studio files)
It seems that either Eclipse 3.5.1 made some backward steps when it comes to installing plug-ins that have dependencies or I haven’t discover some of the available features for installing plug-ins.
Wednesday’s Movies
In case you are out of idea for what movie to watch tonight, let me lend a hand with not one, but four exceptional movies featuring the amazing and ubiquitous Flash Platform:
- Adobe AIR apps on the iPhone and Motorola Droid (Kevin Hoyt, platform evangelist)
- Multi-touch capabilities of Flash Player 10.1 (our mobile evangelist, Mark Doherty, sheds light on these features)
- One app, five screens (Christian Cantrell shows you how you can leverage Adobe AIR to target multiple devices with basically the same code base)
- Event Performance in Flex (the famous Chet Haase amazes you once again)
Enjoy :) !






Android & AIR
PHP & Flex