Vincent Massol wrote:
Actually, there is another example in the pdf book :
if (initialized || disposed) {
throw new IllegalStateException ("Illegal call");
}
if (null == this.manager) {
this.manager = cmanager;
}
Is it the recommended way or do you usually assume that the lifecycle is
enforced ? I have a feeling that you'll answer the following : it depends.
If you're using excalibur component manager then you don't need these checks
but if you're not using any component manager, you'd rather check. maybe not
... let's see ... :)
In any case, I'd like to have your opinion.
Bottom line is this:
You should ALWAYS explicitly enforce your contracts. This leads to secure
components that cannot be interacted with in ways you had no intention of
allowing.
-Vincent
----- Original Message -----
From: "Vincent Massol" <[EMAIL PROTECTED]>
To: <avalon-dev@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 6:14 PM
Subject: compose() method and developing with avalon pdf
Hi,
In the developing with avalon pdf, there is an example of how to implement
the compose() method :
public void compose(ComponentManager manager) throws ComponentException {
if (this.manager == null) {
this.manager = manager;
myGuard = (Guardian) this.manager.lookup(Guardian.ROLE);
}
}
I'm wondering why there is a test to verify if the manager is not null
(i.e.
to verify if the compose() method has not already been called) ? I thought
that the lifecycle for composable would prevent this method being called
twice. Any reason ? If not, shouldn't we amend the doc, as most persons
will
use this doc as their starting point (as I am ... :) ).
Thanks
-Vincent
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
.
--
"Those who would trade liberty for
temporary security deserve neither"
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>