commons-user mailing list archives

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

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
DynaBeans.

The reason why I think that DynaBeans and JSTL may not mesh, is
that JSTL accesses bean properties in JavaBeans-style (foo.bar
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?

Thanks,
Otis


________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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


Mime
View raw message