db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject Re: SV: Interface-Driven Design
Date Mon, 04 Apr 2011 09:34:59 GMT
> I thought about interfaces for the generated classes that have getter /
> setter for all of the properties. I need to use them in a
> multi-classloader environment. The idea was to create an OSGi like
> interface / implementation system. That means you have a JAR with the
> interfaces and a JAR with the implementations (in this case the
> generated classes from Torque).
>
> Torque is able to "generate" interface classes (if they not exist) but
> this are plain interfaces with no methods defined at all. It would be
> great if there is a way to generate full interfaces, as well for OSGi
> environments.
>
> Does anyone know a good way or did an extension for the generation
> process to handle generation of interfaces?

In the past, we have done a similar thing for Torque 3.3 (use non-static
DAOs as Frontend to the static Peer classes). We did rewrite the templates
to achieve this. I do not know any other way nor do I know that such
modified templates are available anywhere on the web.

As the Torque 3.3 templates are rewritten quite heavily for torque 4,
changing the templates for torque 3 would be a throwaway work I'm afraid.

However, for Torque 4 it is planned to allow a non-static version of the
peer classes, but this is not implemented yet. In the meantime, it may be
feasible to generate non-static wrappers for peer classes for torque 4 and
also generate interfaces. This would still involve template-rewriting.

I know this answer is not very satisfying but the pest I can come up with.

     Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message