[opencms-dev] To the developers team

Cory Hubert cory.hubert at ampagency.com
Sat May 22 18:19:01 CEST 2004


> Now is the only problem i see there the point How to create new classes on
> the fly when new modules were installed. For this, we must implement an
>  "On-The-Fly" Way to create the mapping classes and save them to the right
> places. After this we must compile them (this can be done via ANT or
> BeanShell i think)

	AHHH.  I had to deal with this pattern before.   I think our best bet is to
avoid class creation on the fly.  Just generate the SQL and use something
like QueryBySQL in the OR Mapping layer.  OR Mapping is only really
effective if you know your target tables before developing.  I guess the
same holds true for straight JDBC/SQL.  I've created tables on the fly and
in the same user session do CRUD operations against those tables, but it's a
lot of work.  It looks cool when your done though :)

	Which brings me to the ultimate question.  Why do we need to do this?   If
we are installing a new module that creates tables and we can just add the
descriptors for those OR mapped classes dynamically?  Create the table, drop
the classes in the VFS, and dynamically add the class/table descriptor
through the OR mapping api.   We can add it to the main descriptor file so
when you restart the webapp the table(s)/class relationship is still there.

	For backward compatibility.  If it doesn't have any OR mapping in it.  Just
use the OR mapping API as a proxy for the Connection Pool and Db Connection
setting and execute the straight SQL through it.




More information about the opencms-dev mailing list