> And you're really going to have to break both of my arms and/or kick me
> out of Struts development if you want ActionForm *ever* changed to an
> interface again -- in *any* future Struts release.  I think it's an
> absolutely horrible idea, for reasons that have been documented way too
> many times to count.

My plan was to document the reasons for why ActionForm was changed from an
interface to a base class into the Newbie FAQ. I had submitted a patch to
bug 16108 which contains two reasons listed below. I learned these mostly
from reading both lists.
1. Extensibility: If it were still an interface, applications that used an
earlier version of Struts would break if the developers decided to modify
ActionForm in the next release.
2. Correct usage: Struts was designed to follow the Model-View-Controller
(MVC) paradigm and ActionForms were intended to be part of the view. The
purpose of an ActionForm is to represent user input data on the
server-side. It allows you to validate the user data in the view layer
before passing the data to the model. By making ActionForm an interface, a
model object can implement ActionForm which would be convenient at first
but the model would also have to do validation. By doing this, you would
have combined the model and view together whereas the goal of MVC is to
keep these separate. So by making ActionForm a base class, this forces you
to do the right thing.

Any comments? If I got this wrong, please let me know. I know that I've
left out other reasons but I didn't fully understand them.
I-Shen



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to