At 02:53 PM 5/14/99 , you wrote:
>In my opinion Sun made a mistake when including the STM model. Essentially
>it encourages stupid people to stay stupid. I'm not saying that you are
>stupid, I'm just saying that it really does nothing to help newbies learn
>how to write code the correct way.
Well, let's use the word "ignorant" instead of "stupid" since that is what
we are really talking about here; whereas ignorance is a lack of knowledge
and stupidity is the inability to reason or make intelligent decisions.
Everyone is ignorant on one subject or another - most people should not be
characterized as stupid (except for intermittent instances where we all
have done or thought something stupid). Those people who are stupid are as
a general rule going to stay stupid whether Sun includes the STM model or
not - 'nuff said.
Anyway, I don't have a problem with allowing someone use a lightweight or
simple model of something when they need to throw something together
quickly. There is always the potential for misuse but that is another issue
(can you tell I am the kind of guy who pines for C++ operator overloading
in Java? ;-).
>
>See above. The reason why you shouldn't use STM is the entire reason why it
>was developed in the first place; it makes your servlet execute in a single
>threaded environment. The web is a MT environment, multiple people are going
>to be hitting your servlet at the same time. There is no real reason why you
>would want to funnel this through an STM environment unless you depended on
>other code being single threaded and you did not have any choice.
>
For this particular project I do not think this is a problem. I only have
one servlet class. Every form will post to the same servlet (the servlet
looks at the form name and then dispatches the request to the appropriate
non-servlet class). The way I understand the STM from the API docs, if
multiple users are using these forms the servlet engine will invoke a new
instance of the servlet, or use an instance of the servlet from a pool of
instances.
Other code used by the servlet needs to be thread safe yes, but that is not
that much of a problem. Remember, this is not some e-commerce application
that is seeing lots of hits, most of the time only two or three people
(developers) are going to be accessing the database via our *intranet*
(*not* the web) at any one time. Unless we suddenly become the size of MS
we are not likely to need to scale this up either. This is a quick and
dirty internal tool for our developers.
I fully intend to learn all the nuances of multi-threading in Java (I have
done mutli-threading in C++), but I have a limited amount of time to
implement this particular project so I can go back to writing UI components
that will be used in production code.
Anyway, I think I understand the problems now - thank you for your help.
FWIW,
LCB
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html