Frank W. Zammetti wrote the following on 7/7/2005 12:43 PM:
Any reason in getUsers() that you are going directly to request to get the
companyID parameter, as opposed to getting it from the form?

For a full blown app, I'd probably have a "CompanyActionForm" which would hold companyID and I'd use that to be consistant. But you aren't required to use an ActionForm for 'everything.' For a single ID nothing 'that' bad about pulling it straight from the Request.

It might be worth noting that some people dislike the use of
DispatchAction in most cases, me included.  This is a fairly minor point
as the actual code you wrote would be essentially unchanged without
DispathAction, just housed in individual classes.

Agreed. I think I mentioned you could use invidual Actions just as easily, if I didn't I apologize. (If using separate related Actions I still 'might' inherit from a BaseUserAction though to keep certain things like a prep() method in the Base, but that's not a firm requirement).

(For any newbies reading this, the difference that matters is that with a
DispatchAction, you have a single entry in struts-config, but you have to
pass a parameter with each request.  With plain Actions, you would have
multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so
on in this case, but no parameter to pass around.  There are pluses and
minuses to each approach, but they get you to the same basic place in the
end.)

Yup. Both have plusses and minuses. Since so little really goes on in the methods of the dispatch action, I just tend to prefer it but I also the valid claim that separate Actions are good and 'maybe' more OO as well (although that could be debated).


--
Rick

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

Reply via email to