You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adolfo Miguelez <pe...@hotmail.com> on 2002/04/16 11:06:20 UTC
Presentation Layer Design Question
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>