Erik Hatcher wrote:
> How are presentation details embedded in the LookupAction you posted and my
> similar code?  Its just a "key" that it exposes, which is a bridge between
> the view and the controller, much like an ActionForm is also.

It's starting to couple what we want to call the buttons with what the
buttons are suppose to do. If the key were the name of the method we
want to dispatch, then it would not be a presentation detail. (Instead,
we would be embedding a business detail in the the view.) But in
practice, the key will be something that makes sense to the Web
designer. This then leads to naming the methods to match what the
designers want to use for a button key, and so a presentation detail
becomes embedded in the method names.

Dmitri's approach decouples what we call the buttons from what Actions
we call in response. Which is the really the whole point of the
struts-config. It's the DMZ where we map logical names to actual
classes. In this case, the button key is the logical name, and the path
it forwards to is the actual class.


> I still feel (and of course this is a preference issue at this point) that
> its bordering on, if not already past, putting business-specific logic in
> struts-config by doing this kind of thing.  But have fun with this if you
> like!  :)

Yes, I find that the struts-config is the best place to put the
business-end of the controller. This is where we put all the paths and
other nuts and bolts. The Actions call business methods and monitor the
outcome, but the struts-config is the brains of the operation. The
Action senses things like "success" and "failure", but it the
struts-config that decides what to do about it. In truth, the
struts-config is the "controller", the ActionServlet is just the
infrastructure which enables it.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

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

Reply via email to