Re: SV: Interface-Driven Design
Christoph Engelbert <[email protected]> Mon, 4 Apr 2011 12:34:15 +0200
| Newsgroups | gmane.comp.jakarta.turbine.torque.user |
|---|---|
| Message-ID | <[email protected]> |
Am 04.04.2011 11:34, schrieb Thomas Fox: >> 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. > Thanks for your answer. That's what I expected so I changed the implementation to a different approach. Since I still working on a draft implementation of using Torque 4 in OSGi environments I don't want to redo all that stuff for Torque 3 but I was hoping I just missed something in Torque codebase. Cheers Chris