You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nelson, Laird" <La...@FMR.COM> on 2003/04/22 21:22:02 UTC

Design question

A design question for the multitudes.  Please answer with your purist hats
on; I'll munge, trash and destroy the results as needed to get them to fit.
:-)
 
I have a basic web application whose first few workflow steps are
essentially as follows:

1.	User clicks link to begin The Process.
2.	If the user hasn't been here before, then The Process is begun from
the beginning.
3.	If the user has been here before, but hasn't finished The Process,
then The Process is resumed from someplace later than the beginning.
4.	If the user has been here before and HAS completed The Process, then
they are taken to a display page.

At what level should the business facade be designed?  That is, if I
understand the viewpoints of Ted and others on this list, the Action to
which the link submits should simply delegate to a business facade class
somewhere that should take care of the actual logic.  However, who then
would be responsible for selecting the appropriate ActionForward to find?
The Action?
 
The pseudocode for the workflow above is something like this:

1.	Call the system that will return the user's details.
2.	If the details come back null, then the user hasn't been here before
(see (2) above).
3.	If the details come back with fields X, Y and Z filled out, then the
user has completed The Process (see (4) above).
4.	Otherwise, the user has partially completed The Process (see (3)
above).

Is it kosher for the Action to evaluate the user's details and determine
which ActionForward to find based on the results?
 
Cheers,
Laird

--
Laird J. Nelson
Electronic Channel Group, Fidelity eBusiness (Veritude)
* (508) 357-3142
* laird.nelson@fmr.com <ma...@fmr.com> 
* 1075462@skytel.com <ma...@skytel.com> 

 

RE: Design question

Posted by Robert Taylor <rt...@mulework.com>.
Nelson,  I think your on the right track:

The Action class is part of the "controller" and is therefore responsible
for making decisions
on which view to present to the user based on the model state.

I'm not sure what you mean by "At what level should your business facade be
designed?".

If you are trying to determine if the Action or the business facade should
be responsible for
determining which ActionForward to return, I would say the Action. You want
to decouple
the business facade from the specifics of the presentation tier. I think it
is sufficient for the
business facade to return information that may "help" the Action
(or some utility in the presentation tier) make an informed decision.


robert



  -----Original Message-----
  From: Nelson, Laird [mailto:Laird.Nelson@FMR.COM]
  Sent: Tuesday, April 22, 2003 3:22 PM
  To: 'struts-user@jakarta.apache.org'
  Subject: Design question


  A design question for the multitudes.  Please answer with your purist hats
on; I'll munge, trash and destroy the results as needed to get them to fit.
:-)

  I have a basic web application whose first few workflow steps are
essentially as follows:
    1.. User clicks link to begin The Process.
    2.. If the user hasn't been here before, then The Process is begun from
the beginning.
    3.. If the user has been here before, but hasn't finished The Process,
then The Process is resumed from someplace later than the beginning.
    4.. If the user has been here before and HAS completed The Process, then
they are taken to a display page.
  At what level should the business facade be designed?  That is, if I
understand the viewpoints of Ted and others on this list, the Action to
which the link submits should simply delegate to a business facade class
somewhere that should take care of the actual logic.  However, who then
would be responsible for selecting the appropriate ActionForward to find?
The Action?

  The pseudocode for the workflow above is something like this:
    1.. Call the system that will return the user's details.
    2.. If the details come back null, then the user hasn't been here before
(see (2) above).
    3.. If the details come back with fields X, Y and Z filled out, then the
user has completed The Process (see (4) above).
    4.. Otherwise, the user has partially completed The Process (see (3)
above).
  Is it kosher for the Action to evaluate the user's details and determine
which ActionForward to find based on the results?

  Cheers,
  Laird
  --
  Laird J. Nelson
  Electronic Channel Group, Fidelity eBusiness (Veritude)
  ) (508) 357-3142
  * laird.nelson@fmr.com
  % 1075462@skytel.com