Here's a question to all you theorists out there about division of a use-case between model and controller.

I have a use case where my struts app receives a http post from PayPal detailing a transaction which it has just processed for me, taking payment from a customer I sent there from my website.

The app has to verify various parameters and then if correct, update the database to reflect the purchase, by doing the following steps:

(1) check the value of various parameters
(2) use java.net.HttpURLConnect to do an http post back to PayPal
(3) check the response to the post says 'verified'
(4) update the user's records in the database to reflect the confirmed purchase
(5) send an email to user thanking them & confirming purchase


What I am trying to work out is which bits belong to the controller, i.e. in my Action class, and which bits I should write new Factory classes for.

I am thinking of doing (1) in my Action, and writing different methods in a 'PaymentFactory' class: checkPayPal() for (2) & (3), updatePayment() for (4) and sendReceipt() for (5).

Any advice welcome,
thanks
Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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



Reply via email to