4 Dec 2002 12:18
Design Patterns
Mark Grand <mgrand <at> mindspring.com>
2002-12-04 11:18:35 GMT
2002-12-04 11:18:35 GMT
Mark Grand proudly presents Two Design Pattern Courses I am proud to announce that two design pattern course previously taught at U.C. Berkeley are now available to the public. <http://www.clickblocks.com/cgi-sz/webcwrap/szw/st_prod.html?p_prodid=1>Design Patterns in Java is an intensive introduction to Design Patterns taught by the author of the book Patterns in Java. The course is intended for experienced programmers and software engineers who want to better understand object-oriented design or make the transition from software engineer to software architect. [<http://www.clickblocks.com/cgi-sz/webcwrap/szw/st_prod.html?p_prodid=1>Detailed course description] <http://www.clickblocks.com/cgi-sz/webcwrap/szw/st_prod.html?p_prodid=2>Distributed Patterns for Java Enterprise Applications is an introduction to architectural and design patterns for building transaction-oriented and distributed systems. These patterns are reusable solutions to common problems that occur when building distributed or transaction-oriented systems. These patterns focus on issues that are independent of any implementation technology. [<http://www.clickblocks.com/cgi-sz/webcwrap/szw/st_prod.html?p_prodid=2>Detailed course description] Location:(Continue reading)
. I'm doing this fairly vanilla project,
servlets, JSP and JDBC, and I'm getting annoyed at the amount of rote
code I need to write.
A common tactic is having the JSP instantiate a javabean which
will hold all the parameters, then dispatch the request, with
javabean, off to a servlet for processing. Besides instance variables
for the parameters, the bean typically has validation code which
checks the parameters and stores error messages about the failed
validation in another instance variable on the javabean. The JSP
instantiates the bean, uses the "usebean" JSP tag to copy all matching
parameters into the bean (via reflection), calls the validate() method
on the bean, and if it passes stores the bean in the user session (or
in a request attribute) and dispatches the request off to the servlet
for further handling.
Unfortunately, using this approach means I need to code a bean
for each form, and each bean has to have gobs of rote code for the
getters and setters, mostly rote code for the validators and error
messages (though I can easily factor a lot of the primitives for
validation out into reusable methods on a parent javabean class). I
hate doing rote work
RSS Feed