Hi,
Correct. But dont let that discourage you. Your "OOP benefit" should not
be in action class. You can delegate it to other part of application where
it is more applicable.
For example :
Lets say your action adds item to shopping cart. All the complexity , can
be in shopping cart bean where you use all the "OOP benefits" and action
class only knows about simple and clean interface of shopping cart which it
delegates it's hard work to.
HIH
Vladimir
Unfortunately, what this means is that I can get no OOP benefits
in my action class hierarchy. All the object access code has to
be repeated in each action class.
Correct?
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Vladimir Blagojevic
Sent: Thursday, August 24, 2000 4:03 PM
To: [EMAIL PROTECTED]
Subject: Re: Model 2 and large applications - and request
dispatcherthread safety
<snip>
I think my problem then is as you stated it. Because I am caching
the action class instances there is only ever one instance of any
given action class type. Therefore it is possible that a user
request could be issued to the controller servlet and be assigned
an action object instance that is currently being used by another
user, and therefore it gets a copy of the wrong "master bean."
</snip>
It does not matter that you have one instance of an action class or that it
is used by another thread (user). This is the actually way to do it. What
you have to be carefull about is that you dont have any instance variables
in your action class. You dont need them and if you do your logic needs to
be changed!!!
Every user's (thread) call to action's perform method gets executed on a new
method stack of an action class. There is no concurrency issues.
Hope it helps.
P.S
See LogonAction.java from struts.
Vladimir
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets