myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe" <lu4...@gmail.com>
Subject Re: myfaces-faces-plugin - architecture
Date Wed, 30 Jan 2008 19:03:36 GMT
These are my thoughts and my personal opinions on the subject

myfaces-faces-plugin generates 4 things:

component classes
tag classes
faces-config.xml
tld

Synchronize the generation of all this stuff with annotations is very
hard!. For each component we need one file. If this file is an
abstract component class and we put all info still we need to write
the same info as with the xml files. The advantage is that we avoid
the java-template class if we need to use it for component class
generation. Maybe works but where do we put other additional info that
should be used for faces-config.xml?.

The full idea could be this:

- Create an abstract component class that contains all info.
- Create some files where we can get the additional info.
- Generate a component class that extends from this abstract class.
- Generate tag, add info to faces-config and tld based on this info.

This suppose a hard work but this approach could be easier than the
actual behavior.

But I feel it's a little advantage in comparison with the work (we are
writing code that do the same of another code).



For sure, I thought we can generate the stuff and then commit the
generated files, so no need to regenerate for each build, just when
something in the component config changed.


Checking the Mojos of myfaces faces plugin, I have found one cool property:

GenerateJspTaglibsMojo
GenerateComponentsMojo

  /**
   * @parameter
expression="${project.build.directory}/maven-faces-plugin/main/java"
   * @required
   */
  protected File generatedSourceDirectory;

So, with this property we can redirect the generation of all component
and tag classes to src/main/java !!!

At start I suppose that we need some fine grained control (one
property on the xml files to say whether to put
the generated files) but after read the discussion I think is
desirable to get all component and tag classes on the
source dir.

I'm not tested this yet, I will try and see what happens

regards

Leonardo Uribe

Mime
View raw message