Ulrich Mayring wrote:

Berin Loritsch wrote:

Strictly speaking, a stateless component is one that
does not maintain information between method calls (AKA state).

[...]

I.e. there is information that is kept between component uses.

Hello Berin,

this is a different definition than the one from Robert. He said the component doesn't maintain caller state. You seem to say now that the component also doesn't maintain its own, internal state. To me that looks like a big difference.
That is exactly what I meant, that the component doesn't maintain state between client calls. Sorry if I confused you :-)



I tend to agree with your stricter definition, which also IMHO automatically makes it thread-safe.
Not necessarily true. As I mentioned before, if the stateless component maintains a reference to a non thread safe component, say a SAX handler or a JDBC connection, then the component may not be thread safe because the reference isn't. Some apps got into trouble with this when it came to servlets; they used class variables for non thread-safe objects.



> A component cannot be accessed until it is completely instantiated.
> As soon as you have the component in your hot little hands, it has
> already been initialized and put through the lifecycle.

What about dynamic undeploy/deploy?

> However, if the component does not need to store information, and
> does not force the client to call methods in a specific order, then
> all is well.

During initialize() the component stores information and it does matter in which order you call the lifecycle methods :)

Ulrich



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


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

Reply via email to