10:15 am Chip Temm - Model driven development and code generation
Tooling required for model driven development to create code and database from the model.
The presentation was forward looking, presenting ideas where not much code exists yet to do this kind of thing in CF.
Quality is important and the goal is repeatable success. Process is important and should be about developing software rather than to fulfil a management objective.
Documentation is used to pull together the Design, Development and Maintenance process. The code documentation is a big challenge, which developers don't like to do. Using the model to generate the code allows the model to be seen as a key step in the process.
Multiple projects and moving from project to project means the developers will need to move to new projects and the knowledge evaporates.
Is the code clear? Do we need to design documents? Modelling the metadata will communicate the design. You can use reflection to extract the component metadata.
The designs can be copied into other projects and improve the productivity of programmers.
Generating code framework will allow the work to be distributed to multiple developers.
Forward generating code is easier when you have the whole model available.
Refactoring can be made easier. ColdFusion is a difficult language to parse.
The generator can also generate unit test tools.
Tools Overview: Most UML modelling tools now support code generation, Java is the target and CF is not supported out of the box. Adalon has support for Fusebox 4.
Most tools export to XMI and some have extended XMI.
Tigris.org – Argo UML – Free; has a facility to create templates. Sparx Systems – Enterprise Architect - $200 : Goodvalue Gentlesoft – Poseidon - $900 (based on Argo UML)
Choices: Use the XMI and create your own generator.
As an example 2MB file for two classes with a few methods. Most is related to the diagram. So it pays to focus on the model.
Use the tool to define the metadata and generate XMI, which can be used to create the code. The tool will not contain the CF datatypes. You may have to create a package and create CF datatypes in that first.
You can use XSL templates to convert the XMI or use ColdFusion to create the generator.
www.cfopen.org has an experiment called open model to try and do this. The code there is not production quality.
There is also a cfcXMI plugin for Poseidon which create class files for the app using the model.
Sparx has better templating but nothing for CF yet.
Converting code to models (round tripping):
Code needs to have reliable metadata. (Not type = "any")
Define properties with
Challenges: Some tools have support for PHP. We need to show support for CF in these tools. Round tripping CF is hard because it is not XML compliant. Flex should be easier because it is XML and Poseidon already supports Actionscript. Fear of wizards.
Persistence methods are easy to generate but custom methods are difficult or impossible to generate.
Investment cost issues.
How many people I there to change? What will the tools cost?
What is the risk of change?

