Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 41948 invoked from network); 13 Nov 2001 20:11:54 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Nov 2001 20:11:54 -0000 Received: (qmail 16558 invoked by uid 97); 13 Nov 2001 20:11:33 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 16526 invoked by uid 97); 13 Nov 2001 20:11:31 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 16470 invoked from network); 13 Nov 2001 20:11:29 -0000 Message-Id: <200111132011.fADKBRD00323@mail004.syd.optusnet.com.au> Content-Type: text/plain; charset="utf-8" From: Peter Donald To: "Avalon Developers List" Subject: Re: compose() method and developing with avalon pdf Date: Wed, 14 Nov 2001 07:08:28 +1100 X-Mailer: KMail [version 1.3.1] References: <048a01c16c6f$101006e0$0200a8c0@vizzavi.fr.corp.vizzavi.net> <049401c16c6f$8303ab70$0200a8c0@vizzavi.fr.corp.vizzavi.net> <3BF167A9.6060702@apache.org> In-Reply-To: <3BF167A9.6060702@apache.org> X-Wisdom-Cookie: . MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: For additional commands, e-mail: