On Wed, 16 Mar 2005 04:33:12 -0800 (PST), Konstantin Priblouda
<[EMAIL PROTECTED]> wrote:
> 
> --- Ted Husted <[EMAIL PROTECTED]> wrote:
> 
> > IMHO, Actions are fine the way they are. The one and
> > only problem is
> > that people keep trying to use Actions (and Struts)
> > as a component of
> > a business logic framework, rather than as an
> > *adjunct* to a business
> > logic framework.
> 
> I'd like to disagree on this matter. Worst problem
> with struts actions is that they need to be derived
> from  basic actions.  This makes them pretty
> unflexible.

I agree with Ted, and the reasoning he states.  Indeed, in this
particular respect, Action *should* be inflexible because making it an
interface would encourage you to use it incorrectly.

> 
> Implementing interface would be better option
> ( well, you could always say that thise who "like to
> implement interface"  may go straight to webwork )

Or, those who like POJOs can go to JSF, which doesn't really need
Action or ActionForm APIs :-).

> 
> The same problem with form beans....
> 

History lesson time.

Prior to Struts 0.5 (in 2000-2001), ActionForm was indeed an
interface.  It became clear that a large majority of the audience for
Struts was misusing it, by making their VO beans "implement
ActionForm" -- violating the principle that ActionForm was, and is,
part of the View tier (not the Model tier.  It was changed into a base
class precisely to avoid this.

As you might imagine, this was a controversial decision then.  But I'm
sure glad we did it.

> 
> > My concern would be that POJO Actions sound like a
> > slippery slope that
> > will encourage more people to write applications
> > with Struts, rather
> > than *into* Struts.
> 
> What's wrong with it? I need from web framework:
>  - handling request parameters in sane way.
>  - dispatching  to whatever action is necessary
>  - providing support for template rendering.
> 
> I definitely do not like to know anything about struts
> in my business logic.
> 

That's the right answer.

> 
> > Actions should be a thin adaptor between Struts and
> > the business-end
> > of an application. The business-end can be written
> > as Commands or with
> > POJOs. But, we are not do anyone any favors if we
> > encourage people to
> > write Actions with "POJO" Actions.
> ... then struts will become webwork 1.4
> 
> > As Manfred mention, a good compromise might be make
> > Action an
> > interface sometime. People would then at least have
> > to import the
> > interface to mark what classes they are using as
> > their Struts adapter.
> 

Backwards compatibility aside, I think we'd see misuse.

> ... and trash form beans for good.

Already done in Shale.  JSF has built in capabilities that solve the
problem form beans are there for (redisplaying the string form of
incorrect input, and annoying quirks with the way checkboxes get
submitted in HTML).

> 
> regards,
> 

I'll leave the rest of this thread to those wanting to talk about
Struts 1.3's architecture, which I'm not overly interested in.

Craig

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

Reply via email to