Hi all,
after studying the example app, I have a question regarding
form bean creation:
As it looks, there is some unnecessary code in the example, that
makes it hard to understand the responsibilities of the participants.
I'm talking here particulary about the (form) bean creation, that is
done in two (to be exact, in three) places.
>From my understanding, for all *.do requests the ActionServlet will
roughly ...
- lookup the mapping;
- lookup the form bean;
- create it, if necessary (processActionForm());
- populate it;
- call the Action's perform() method.
However, in most of the examples actions, there is code, that checks
for null form beans and creates them (if they're null). Can this
really happen ? What's my error and what's the codepath, where
the specified form bean is <null> at the point when perform() is
invoked ?
BTW: The choosen names of ActionForm, ActionFormBean and ActionForward
makes it unneccessary difficult to understand the intended use of
those classes (at least for me :)
It's even difficult to write about them. When I'm writing about form bean's,
do I mean ActionFormBean's or do I mean ActionForm beans ?
The reader (you) has to look at the context, to determine, what I mean.
>From my experience, this is exactly what Kent Beck calls a "bad smell".
Or is it just me - not being a native speaker - that has this "problem".
IMHO, a more consistent naming would be...
ActionForm -> (Action)FormBean
Reason: They _are_ beans! intended to be used in conjunction with forms!.
ActioNFormBean -> (Action)FormBeanMapping
Reason: An ActionFormBean's primary use is to map! a name
to a form! bean! for use with actions!.
ActionForward -> ? (ViewMapping?)
Reason: Not so easy. Forward has a special meaning when used in JSP
context. Maybe something with View! in the name would equally
good express the intention, w/o conflicting with "forward".
Opinions ?
--
Thanks for your help
Matthias mailto:[EMAIL PROTECTED]