Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 98837 invoked from network); 13 Oct 2003 08:10:15 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Oct 2003 08:10:15 -0000 Received: (qmail 81675 invoked by uid 500); 13 Oct 2003 08:09:46 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 81615 invoked by uid 500); 13 Oct 2003 08:09:45 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 81504 invoked from network); 13 Oct 2003 08:09:44 -0000 Received: from unknown (HELO border.matera.net.au) (203.22.237.130) by daedalus.apache.org with SMTP; 13 Oct 2003 08:09:44 -0000 Received: from border.matera.net.au (localhost.localdomain [127.0.0.1]) by border.matera.net.au (8.12.8/8.12.5) with ESMTP id h9D89taF028026 for ; Mon, 13 Oct 2003 18:09:55 +1000 Received: from localhost (matthew@localhost) by border.matera.net.au (8.12.8/8.12.5/Submit) with ESMTP id h9D89soJ028022 for ; Mon, 13 Oct 2003 18:09:54 +1000 X-Authentication-Warning: border.matera.net.au: matthew owned process doing -bs Date: Mon, 13 Oct 2003 18:09:54 +1000 (EST) From: Matthew Firth X-X-Sender: matthew@border.matera.net.au To: commons-dev@jakarta.apache.org Subject: Re: [chain] no chain iterator? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N >>Has anybody considered a chain iterator? >Why do you need to do this yourself? The particular case I have is a "status" page that dumps the state of the web application - what configuration options have been loaded and enabled, the state of certain components (like the size of the connection pool). What I was hoping to do was that for some set of Chains that are configured during initialisation, show the Commands that have been configured in each and then also interrogate each command (reflection/bean introspection) for some of its properties/configurations. Hence, my desire to be able to iterate the currently configured commands in a chain! >The point of the Chain is to >execute the relevant Commands for you. True, but does that mean that the chain should/must(?) become inpenetrable after it has been created? >Nothing like this should be added to the Chain interface itself -- >that would be exposing internal details that should be of Given that the 'contract' of Chain is to execute some sequence of commands in order, I'm not sure that telling an external party what that *sequence* will be is an "internal" of the Chain. >In addition, it would be redundant to add this to ChainBase because it >is trivially simple to add in your own subclass of ChainBase True enough. I have no huge objection to doing that, but now I'm more interested in your reasoning than your original answer :) >or the unit tests for the Chain implementation (which is why the >package private getCommands() Using package private access to allow your unit tests better access to the code always feels "wrong" to me.. That is probably why the Iterator concept makes sense in my mind... but maybe not to other people :) >I would consider any other code that wants to mess >around with the internals of the chain as a potential danger signal I agree that anything that was to *change* the state of a Chain instance is most certainly a danger signal, but I'm still not sold on the idea that a chain can be told what to do, but nobody else thereafter is allowed to find out about it.... :) matthew --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org