Re: Improvements to ClassGenerator and ant task

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jan 28 2004 - 10:24:46 EST

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-86) NOT Expressions donot get printed properly"

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > total class generator revamp. This is a sensitive issue in part because
    > WOProject wogen depends on it.

    I will take a look at wogen and see what the dependencies are.
    Just from the cayenne side of things, I don't think a rewrite is necessary.

    > Since users
    > can't reprogram the model Java classes on the fly, extension via
    > scripting is the only thing they have. So I guess instead of patching
    > ClassGenerator, we should deprecate it all-together (keeping it in the
    > template context for backwards compatibility), and create a separate
    > utility/model classes.

    One thing you can do with Velocity is load in utility classes (toolbox) on
    startup. I've begun doing this with my email velocity templates. This
    might provide all of the extensibility needed (for example, all of the stuff
    I previously described as being in a utility class could be in a toolbox
    class) without needing to support it in Cayenne. I'll see how feasible that
    is.

    > Ant already supports advanced file name mappings:
    >
    > http://ant.apache.org/manual/CoreTypes/mapper.html
    >
    > We can simply support this as a nested element. This is probably more
    > coding than simple prefix/suffix, but it takes advantage of a very
    > powerful built in facility. I guess if we go this way, we'll have to
    > switch Modeler to use ant task as well - so that it would support
    > everything cgen does. Once cgen is updated, I will take care of the
    > modeler part.

    Yes, that does appear to support all that. However, since the ant task is
    just a wrapper to the actual cgen, I don't see why you'd want to have the
    modeller call cgen using the wrapper. I suspect that the wrapper merely
    pre-generates the appropriate file names and provides them to cgen (I'll
    have to do more research). There's no reason that the modeler can't provide
    the filenames directly.

    -Mike



    This archive was generated by hypermail 2.0.0 : Wed Jan 28 2004 - 10:24:03 EST