Subject: Re: Presentation Layer Design Question From: Vic Cekvenich <[EMAIL PROTECTED]> === Can't speak for Craig, but the Beans give me a way to isolate the DB layer. I use CachedRowSet to hold Result and have meta data at any time. It is one step and does not do mapping. Since the DB layer is isolated, I can now have non web Apps use the beans, such as SOAP, etc. I think beans are more traditional. hth, Vic
Adolfo Miguelez wrote: > Hi All, > > I am wondering about a design issue since I can not figure out why Craig > implemented in that way. Any light or opinion would be appreciated. > > The point is that usually, AFAIK, results from database queries are > planned to be stored in ArrayLists of beans. This ArrayList of beans is > sent to the JSP which, in turns, by using <logic:iterator> and > <bean:write> tags can, for instance, work out a table. > > After many headaches, we choosed to do the same by using an ArrayList of > HashMaps. HasMaps are filled with results from database with the same > info that beans. In our humble opinion, storing each database row in a > hashmap is easier vs storing in a specific bean. The points are: > > - In both cases info about database headers is stored once for each row, > either get/set methods or key value of the hashmap, (no difference in > this matter), > > - However a general ArrayList of HashMaps can be enought for holding all > the database result queries vs a specific bean for each query in the > Craig appproach. This would become the system much more mainteinable, > since we have a general holder for all the queries rather than a > specific one. > > We developed a tag to inspect a value in the hashmap indexed by a key > and render such a value to the JSP, equivalent to how <bean:write> > inspects a get*** method of the bean to get the parameter. > > The question is: > > Is there any performance cost or design problem with this approach? Why > Craig did not take it? > > Any comments in relation with this design are very welcome. > > Regards, > > adolfo > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

