struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wbchm...@Ensign-BickfordInd.com
Subject RE: DynaBeans, DynaClass, DynaMen
Date Mon, 01 Jul 2002 16:10:06 GMT

If I followed this approach and wanted to implement it across many 
pages, would I just code the interface for every possible field that 
could be returned?  I am not sure and I left my patterns book at home 
today (seriously).




-----Original Message-----
From: cliff [mailto:cliff@onsea.net]
Sent: Monday, July 01, 2002 11:28 AM
To: struts-user
Subject: Re: DynaBeans, DynaClass, DynaMen


wbchmura@Ensign-BickfordInd.com wrote:

> Anyhow...  I got a Dynabean mechanism working that builds a DynaBean 
> based on the metadata of a SQL result set, populates and array of the 
> little buggers and passes it back to me.  For displaying I have a tag 
> library that does not like a call to get('name') as the field name.   
> What is the best way to get around this?

I presume you mean a non struts-aware tag library?

> (A) Write a bean to encapsulate the dynabean and provide hard method 
> gets and sets
> (B) Modify the tag library to detect a DynaBean and access it via a 
get 
> and set (not my library)
> (C) Don't use dynabeans for this sort of thing
> (D) None of the above you dufus

Another approach (I've not tried it, so I can't comment on 
success/failure) could be to use a proxy class (reflection) and a proxy 
interface for the dynabeans you want to access.  It's not much different 

from option (A), but if you were to meet the same requirement in several 

different places it would save you some time.  You can see this kind of 
approach in CMP EJB, where the interface declares the methods that may 
be called and the proxy takes care of the implementation.

> Thanks and happy monday

Bah. ;)

Cliff Rowley


--
To unsubscribe, e-mail:   
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: 
<mailto:struts-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message