Here is finally the last part of this serie. I will now create the last layer of Mihai Corlan’s application replacement.
Just to remind you, in the 1st part, I built a prototype of Acceleo template to generate the Doctrine2 php entities from a UML model. In the 2nd part, I built an Acceleo template to generate the skeletons of the php services that use these entities. In the 3rd part, I used the 1st entity UML diagram to generate the actionscript Value Objects from another Acceleo template. This lead to a fully usable as3 code layer, no additionnal code was required in this layer… but the as3 Value Objects layer is actually usable only by the last layer that we are about to generate with a 4th template, the actionscript service wrappers.
Continue reading »
Here comes the 3rd part of this serie about PHP/Flex code generation using Acceleo, coupled with a UML diagramming tool, Modelio.
In the 1st part, I built a prototype of Acceleo template to generate the Doctrine2 entities from a UML model. In the 2nd part, I built an Acceleo template to generate the skeletons of some php services that manage our doctrine2 entities. All based on the great work of Mihai Corlan about the implementation of a Doctrine2-ZendAmf-Flex stack. With these 2 first parts, the server side of the application has been automatically generated and supplemented with the implementation of the code.
It is now time to focus on the client side to replace the actionscript code generated by FB4 for the service wrappers and the value objects (code generated through the use of the Data/Service features of FB4 - very handy feature anyway ). Let’s start with the AS3 value objects.
Continue reading »
Here is the second part of my serie about the code generation in the stack Doctrine2, ZendAmf and Flex using Acceleo and an UML diagramming tool, Modelio.
In the 1st part, I built a prototype template to generate Doctrine2 entities. This is only a prototype and an example, as you must define your own rules and policies for your own model design and template definition.
In this second part, we will continue to replace the code written by Mihai Corlan, with our generated code. We will focus now on the PHP services and as you will see, this is really simple as there is no specific rules like for Doctrine2 annotations. There are only your design rules (mine actually in this post :p ).
You can get the source of the templates here: Doctrine2_UML_Code_Generation (268). And you can get the Mihai’s code: here and refer to the 1st part to install the environment.
Continue reading »
I am more and more interested in the integration of PHP and Flex. Especially, using Doctrine2 as an ORM. So, I walked trough a great article written by Mihai Corlan, giving an example of how to work with Doctrine2, ZendAmf and Flex, using Flash Builder, of course. It was clear, easy to reproduce and the data-centric development feature of Flash Builder, the Data/Service tab, is really a great feature to introspect PHP classes and create the service wrappers as well as the AS3 value objects. It is a long time that I wanted to test this feature. It is very cool but I was actually really amazed until I opened the code generated by Flash Builder for services and value objects. It was too complicated and totally unmanageable for me. So, in a project, either I manage this part as a black box (which is probably the easiest way to do, trusting Adobe team in generating a light-weight and performant code), either, I find another code generator.
The second point that made me uncomfortable, with Doctrine2, this time, is that I missed a way to get the "big picture" of the entities: a diagram. In the Mihai’s example, the context is very simple, 4 entities… ok. But in a real, big project, managing (I mean, creating and maintaining) more than 40 entities and their relationships would be terrific without a diagram… a UML diagram.
So I decided to reproduce Mihai’s example in a different way. I want to:
- start from a UML diagram, modelling the application - just including Doctrine2 entities and php services,
- generate and maintain Doctrine2 entities that I don’t want to care,
- generate the server-side services (at least a skeleton of methods),
- replace the code generated by FB4 on the client side.
I don’t want to:
- rewrite the client application (just reuse Mihai’s methods),
- rewritte the php services (just reuse Mihai’s methods),
my main goal being to test the feasiblity of a full code generation in the Doctrine2 / ZendAmf / Flex configuration, based on a UML diagram.
Continue reading »
I’m playing ZendAMF for a few days and I found that a patch increasing the performance has not been integrated in the very last release (1.10.8) although it is available since the 1.10.4. You can find details in the ZF issue tracker:
I don’t understand why it has not been integrated as it represents only 2 lines of code to be modified.
So I decided to patch my ZendServer to measure the gains and compare to AMFPhp. For that, I used the excellent comparison tool provided - with sources - by PhilFlash. This is actually the only independant, objective and clear tool that I found on the web to compare the performance of ZendAMF and AMFPhp (+ gzipped XML transfers which are even faster than AMFPhp).
So here is my results showing the performance gains obtained on my laptop as Apache/MySQL server (you can check in the comments of the issue 7493 that some guys found more important gains).
2 measures to retrieve 10.000 simple records:
- ZendAMF 1.10.8 (longest bar)
- patched ZendAMF 1.10.8 (middle bar)
- AMFPhp (shortest bar)
(the PhilFlash’s application has been modified to add my specific test)
So just on my laptop, the patch makes ZendAMF’s performances closer to those of AMFPhp.
So I encourage ZendAMF users to vote for the ZF-10487 and in the meantime, use this patch. I also hope that more work will be done to continue to improve ZendAMF perfs…