Forgot that you also need a DTO interface and impl. Part of the decision about
code generation vs. dynamic class instantiation depends on how the rest of the
application interacts with these objects. For example, if the application
expects DTOs to be DynaBeans, you don't really need a DTO interface and it would
probably be pretty easy to dynamically create the DTO classes on the fly. In a
simlilar vein, if the application interacts with the DTOs through the beanutils
package, you could also leverage DynaBeans (or whatever else you want) without
the need for a statically defined interface and impl. On the other hand, if the
application needs a specific interface type to be able to invoke specific
methods, then code generation seems to make more sense.
If you go the code gen route, you'd want a process where the XML can serve as a
base for both the DTO and the ActionForm. If you're familiar with XSLT, you
might consider using it to generate a <form-bean> element for a DynaActionForm
instead of generating a Java source file.
Quoting Wendy Smoak <[EMAIL PROTECTED]>:
> Kris wrote:
> {snip summary of how it works}
> > Not sure what you mean by "The database behind the DAO layer is
> multivalued".
> > Since you're not using JDBC, is there another way to get metadata from
> the
> > database about the fields you're interested in?
>
> Multivalued as in non-first normal form. I have fields that hold more than
> one value, and some of those are positinally related. I believe the
> equivalent concept in SQL is "nested tables".
>
> The database metadata does not change very often, so I'm currently planning
> to generate the XML from the database to a text file, then feed that to
> something Java based. Sounds like "Digester" is the concept I was hunting
> for.
>
> But yes, there's a Java API (UniObjects for Java) that allows direct access
> to the database from Java. The metadata is stored in a "dictionary" that's
> essentially just another data file.
>
> I'm still waffling on code generation vs. dynamic class instantiation of
> these DTO'S though. Since the metadata rarely changes, I think it would be
> "cheaper" and probably easier to debug if I just generate the .java file
> for
> the interface & implementation and then compile it with the whole project
> as
> if it's a "normal" DTO.
>
> Thanks for the ideas!
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
>
--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]