At 10:53 pm 12-06-2002 -0700, you wrote:
> >
> > >If you do that, just be aware that you are expressly violating the purpose
> > >for which ActionForm was created in the first place, and are also
> > >establishing a dependency in your model classes on both Struts and the
> > >servlet API -- which can make such classes less reusable.
> > >
> >
> > To a certain extent, this consequence is 'historical'. If the formbean api
> > had been decided not to tie up to the Struts and servlet API, we would not
> > see this dependency problem. So, I think one outcome of this discussion is:
> > 'does it make sense to "correct" this historical issue to allow less
> > restrictive usage of formbean by changing the formbean api?'
> >
>
>(Note that, totally aside from any discussion over whether this *should*
>happen or not, changing this would break every single form bean in every
>single Struts-based app in existence, which is *not* a good idea :-)


Fair enough.

Just wondering about the possibility (and put aside whether it's right or 
wrong): can the formbean api be broken in the following fashion?

   interface SuperFormBean {}
   class     FormBean extends SuperFormBean {}
   class     FormBeanAdaptor extends SuperFormBean {}
   interface FormBeanAdaptee {}

where both SuperFormBean and FormBean have the same signature of the 
existing FormBean in 1.1 and FormBean contains the current logic. 
FormBeanAdaptor will adapt a FormBeanAdaptee which does not depend on 
Struts and servlet api. Then, application code can implement 
FormBeanAdaptee which can be 'reused' also in the model/data tier.

Well, I haven't thought this through thoroughly. This is plain wild 
speculation.



>I think I might have some claim to knowing the actual history here :-).
>
>Up to the Struts 0.5 release, ActionForm was in fact an interface.
>However, what became apparent is that people were either misunderstanding
>or misusing them, so it was deliberately changed (by me) to be a class
>instead, *precisely* because of the issue that is the heart of this
>discussion thread.


This is medieval part of Struts' history. :-p
Anyway, my use of the word 'history' was not quite to the point.

-- 
John Yu                       Scioworks Technologies
e: [EMAIL PROTECTED]         w: +(65) 873 5989
w: http://www.scioworks.com   m: +(65) 9782 9610

Scioworks Camino - "Rapid WebApp Assembly for Struts"


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

Reply via email to