Flex Pasta » Flex Model Code Generator (and not just a single use)
Flex Model Code Generator (and not just a single use)
2 1/2 years ago I published annotations for BlazeDS that allowed for placing tags on Java getters/setters to determine if a value is serialized to the Flex client. Soon I will publish a 3 part BlazeDS extension that does the following(with annotations of course).
- Serialization Profiles with BlazeDS - This was mentioned in a previous post and I will be releasing this soon along with the rest of the annotations code.
- Mate Code Generator - More details to come, but if you are familiar with the Mate Framework, this code generator will create complete EventMaps/DataManagers/Events from Java services(and it runs for the life of the project).
- Model Code Generator - This isn’t the kind where a button is pressed once to create Flex remote object bean classes. I don’t like code generators that only generate the file initially. I also don’t like when a code generator creates generated code that then the developer must extend(ex: Customer extends _Customer). I have created a code generator that does neither but still can be run endless times for the life of the project. Here is an example output file. The developer can add any code to the area marked as such in comments. Every time the generator is run it will clear out the rest of the file and regenerate the properties from the matching Java class.
/* File Generated by FlexPastaDomainGenerator v. 1.0
* Only edit the file in the designated area.
* All other changes will be lost
*/
package com.company.model
{[Bindable]
[RemoteClass(alias=”com.company.model.Address”)]
public class Address
{
public var country:String;
public var lot:String;
public var parcel:String;
public var state:String;
public var streetName:String;
public var streetNumber:String;
public var subdivision:String;
public var uuid:String;
public var zipCode:String;//**********EDIT AREA**********
//**********END EDIT**********
}
}
Looks for more details in the coming weeks!
4 Comments
1. Kenton replies at 25th August 2010, 9:38 am :
Again very exciting! I’ve made modifications to Blaze Monster to only pay attention to annotated properties, this seems even better. Fingers crossed I get the chance to use and contribute to these tools.
2. Marvin Froeder replies at 12th September 2010, 2:01 am :
I really would love to integrate this to flexmojos… I hope you publish that on any maven repo
3. Kenton replies at 12th November 2010, 4:43 pm :
Just a friendly *nudge* hoping for a status update on the serialization profiles. I’m doing all sorts of gymnastics to approximate the same thing.
4. Kenton replies at 10th January 2011, 1:21 pm :
Brian, I hate to be pushy on a free product. Would you be interested in sending me an e-mail to discuss the possibility of paying a consulting fee for early access to this? I’ve attached my e-mail to this post.
Leave a comment