On Wed, 14 Nov 2001 05:34, Berin Loritsch wrote: > 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.
Personally I say "it depends" ;) I think it is the containers responsibility to maintain object lifecycle (and thus it will never call compose multiple times). I don't think other objects should get access to raw object except via proxys and thus you never have to worry about other people calling method. (and that is pretty much how Phoenix operates). -- Cheers, Pete --------------------------------- I think not; therefore I ain't... --------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>