Dealing with HTML maintainability in code generated apps
18/05/2009. Evangelina Martinez Ruiz Moreno
The advantages of code generators are well known by any developer. They help you increase the productivity by speeding up the coding process and avoiding repetitive programming. However developers are a bit skeptic about what the code generator can do for them when they encounter requirements that exceed the capabilities of the generator or that require customizing the resulting code. Moreover, what happens when they need to change something they have already generated?
How can you customize a code that will be overwritten each time you regenerate it?
When you are dealing with an object oriented programming language like Java that?s not an issue. You can extend a generated class and make all the changes you need. But what happens when what you want to change is an HTML page? Not so easy then, right?
JRapid came up with a solution for this problem.
Every HTMLi page generated by JRapid has two files attached, one with the extension script and the other with the extension style.
The first file allows you to add javascript code to the HTMLi page by defining the actions that will take place when some event is triggered in a given element of the page.
The second file, on the other hand, lets you specify the CSS style.
These two files provide great flexibility by letting the programmer write its own scripts and styles but remaining untouched during the code generation.
However these are not the only files you can attach to an HTMLi page. As I will explain in one if my next articles ?Not my mother tongue: projects abroad & foreign languages? you can also add translation files to cope with different languages.