Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 23214 invoked by uid 500); 14 Aug 2003 19:36:35 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 23200 invoked from network); 14 Aug 2003 19:36:34 -0000 Received: from dsl-217-155-97-60.zen.co.uk (HELO dsl-217-155-97-61.zen.co.uk) (217.155.97.60) by daedalus.apache.org with SMTP; 14 Aug 2003 19:36:34 -0000 Received: from apple.int.bandlem.com ([10.0.0.20] helo=ioshq.com) by dsl-217-155-97-61.zen.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 19nNtn-00038d-00 for ; Thu, 14 Aug 2003 20:36:39 +0100 Date: Thu, 14 Aug 2003 20:36:42 +0100 Subject: Re: [Error handling] NullPointer or IllegalArgument? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Alex Blewitt To: geronimo-dev@incubator.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: <6312B9C0D5069E42B5107D1635CAC2EA1422AA@calnte2k010.insidelive.net> Message-Id: X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Thursday, Aug 14, 2003, at 19:07 Europe/London, Day, Jem BGI SF wrote: > [Originals Snipped] > > IMHO the bigger question is where you set the boundary for 'trusted' > code. > > It's really the 'public' APIs and services/modules that should ensure > all > arugments are valid before proceeding. The inner workings of Geronimo > should > really be able to trust that it's being invoked correctly - it becomes > a DbC > issue (adding @pre, @post, etc javadoc tags might be an idea). > > Whilst i'm sure in the early days of development/integration adding IAE > everywhere will speed up fault diagnosis there is a potential that > performance will suffer down the road. I'm not sure it will actually make that much difference. You are just doing a single 'if' test, not unlike logging messages. I'm sure we could argue that taking out all debugging/logging messages will make the code go faster, but it'll certainly be easier to manage with it in. And remember, 95% of the time is only spent in 5% of the code -- so only optimise that 5%, and only then do it after you've shown there is a bottleneck worthy of optimisation :-) Alex.