commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otisg <>
Subject [BEANUTILS] DynaBeans as DTOs used with JSTL?
Date Tue, 28 Oct 2003 15:16:50 GMT

I am trying to come up with a simple and flexible solution for
implementing DTOs and I am considering DynaBeans in order to
dynamically create JavaBeans that could play the DTO role,
instead of creating a number of dumb JavaBean classes.

In my context, these DTOs would be used as the means to pass an
elegant and simple chunk of data from Business Logic objects to
the View layer.
I am not concerned with the network/efficiency between the two.
I am only considering these DTOs in order to avoid the passing
of inellegant 'hashes of hashes of list of foo and bar and blah
blah' structures to the View layer.

DynaBeans sound like a good idea at first, but because the View
layer in my case uses JSTL, I am not sure if I can use

The reason why I think that DynaBeans and JSTL may not mesh, is
that JSTL accesses bean properties in JavaBeans-style (
is translated to foo.getBar()).

On the other hand, access to properties in a DynaBean is via
set(String) and get(String) methods, which the View layer using
JSTL could not invoke.

So my questions are:

- Am I wrong to even consider DynaBeans for this?

- Am I wrong in assuming that DynaBeans and JSTL can't play
together nicely?

- It sounds to me like it should be possible to write an Adapter
for DynaBeans, maybe using java.lang.Proxy(?), in order to
convert foo.getBar() calls from JSTL to foo.get("bar") that
would work with a DynaBean.

- Has anyone done this?


Get your own "800" number
Voicemail, fax, email, and a lot more

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message