|
below is the main reason that he is against using it: <Clip from the lesson III> NOTE:I've decided now that I really hate DynaActionForms. So, although I demonstrate their use here, I strongly discourage their use. The main reason I am not fond of them is because there are no compile-time checks when using them. In other words, to manually set a DynaForm field you do something like: yourDynaForm.set("myProperty", myValue );. Well this will always compile, but what if "myProperty" really isn't the field name that you have defined? You won't know until run time.(Creating a Constants class for your form field names helps, but you could still run into the same problem if the property in the actual form bean definition was changed, and it wasn't changed in the corresponding Constants class). Bugs can easily creep into code that are more difficult to track down using DynaForms. More than likely you also usually end up having to build a regular form bean which extends a DynaActionForm because you realize later on that you have to over-ride the reset method or you may even need some custom validation in the validate method. So now the only advantage you've gained with your DynaForm is you didn't have to create set/get methods. But how difficult is that? Most IDEs will do that for you anyway. So, save yourself the later headaches and just use regular ActionForms. <Clip from the lesson III> >From you respond, seems like you did not find that to be a big problem. -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]On Behalf Of Glenn Holmer Sent: Friday, December 03, 2004 10:43 AM To: Java Programming on and around the iSeries / AS400 Subject: Re: newbie - DynaActionForm, EJB and easystruts Lim Hock-Chai wrote: > I went thru a lesson on this web site > http://www.reumann.net/struts/lesson3.do and the author is not recommending > using DynaActionForm. Is anybody using this method? If it does cause > problem as the author described, I will try to avoid this. I didn't do the lesson, why does he recommend against it? We use DynaActionForms all the time. You only need to code your own ActionForm in unusual cases.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.