Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 32799 invoked from network); 27 Aug 2008 15:52:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Aug 2008 15:52:18 -0000 Received: (qmail 48542 invoked by uid 500); 27 Aug 2008 15:52:16 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 48490 invoked by uid 500); 27 Aug 2008 15:52:16 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 48479 invoked by uid 99); 27 Aug 2008 15:52:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2008 08:52:16 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.136.44.63] (HELO smtp108.prem.mail.sp1.yahoo.com) (98.136.44.63) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Aug 2008 15:51:18 +0000 Received: (qmail 23102 invoked from network); 27 Aug 2008 15:50:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Message-Id:From:To:In-Reply-To:Content-Type:Content-Transfer-Encoding:Mime-Version:Subject:Date:References:X-Mailer; b=YT/XWK6Ai1Dckpd2OejfItaDGLKqliyyhpZ5lyDnhHJCva4YiV6NPXhM2sdt3QHJC27ZD85Bx+FFlqiJjWcqvLVK+Y+X4CZF/Wc0EM8FeFxBzHzMgeHONUxY8aV8i/O7FBmPecXmPKeZeNTmANcrwOAiLe79haJepe5EB3HscXg= ; Received: from unknown (HELO ?192.168.1.110?) (david_jencks@76.105.175.1 with plain) by smtp108.prem.mail.sp1.yahoo.com with SMTP; 27 Aug 2008 15:50:47 -0000 X-YMail-OSG: zF3x.acVM1nMOOgx.uhK6MUP7U45YRg46CA9gioUDRwa5bumj1RRPzN7R4NxbSe3gDf6gKZ0ho2XRUL7ByhYZDpj1xPUISQxczg_SZFYNuo6IV0OZ7USqifBMVzcQGpueX91CyPNa1KARA4FmeR57A-- X-Yahoo-Newman-Property: ymail-3 Message-Id: From: David Jencks To: "Apache Directory Developers List" In-Reply-To: <48B52502.1060809@sharp.fm> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5? Date: Wed, 27 Aug 2008 08:50:46 -0700 References: <48B46741.3040008@labeo.de> <48B4722E.8040403@gmail.com> <48B52502.1060809@sharp.fm> X-Mailer: Apple Mail (2.926) X-Virus-Checked: Checked by ClamAV on apache.org On Aug 27, 2008, at 2:57 AM, Graham Leggett wrote: > Emmanuel Lecharny wrote: > >> not only is this complex from the user POV, but from the developper >> POV, this is a nightmare. I frankly don't like those annotations >> stuff, plus the fact that the objects are instanciated during the >> xml file processing is a real burden (and makes the configuration >> file way too complex). >> I will talk my mind : I think that going for Spring was a big >> mistake. > > I have to agree at this point. > > My key experience with Spring is with debugging issues with it. On > the last major project, virtually all issues that managed to slip > past continuous integration were caused by mistakes in Spring files, > which march straight past the compiler and in many cases past the > unit tests and are found by the end user instead. > > The worst problem was a stray 'singleton="true"' that someone had > put on a bean by accident through some careless cut and paste. It > caused some financial reports to return subtly different data when > the reports were repeated, and took over a month to find and fix. > The end result was a whole host of assertions in the code entitled > "dodgy stuff that Spring might do", and it aged us by years. > >> Now, what can we do ? I think that the way to go is to have the >> configuration in the DIT, with LDIF based configuration files (like >> OpenLdap has). > > What I have been doing with config files is defining the structure > of the config files with an XSD, and then reading in the config file > at the outset using xmlbeans autogenerated from the XSD. > > Like Spring, your config files are in an XML format, and like > Spring, you end up with a set of Java beans that you can query to > read your config, but unlike Spring, the format of the config file > has a fixed structure validated against an XSD, and your code is > validated by your compiler before it hits the end user. > > What this gives you is a (reasonably) sensible error message if the > user makes a mistake in the config file, as you ask xmlbeans to > validate the file when you read it in. > > In addition, making changes is a breeze: Change the XSD, regenerate > the xmlbeans, wherever you have a compile error, that's where you > need to change your code to support your new structure. Offhand I don't see why this is better than spring + xbean-spring, where you get an xsd generated from your classes that your server.xml plan can be validated against. Furthermore you don't have to write the code that translates from the xmlbeans objects to the runtime components, as spring does that part for you. Could you explain? However if anyone decides to go in this direction I think that using jaxb instead of xmlbeans, and more particularly sxc, is definitely the way to go. I think there's a good chance that it would be easy to make the runtime components actually be the jaxb objects. thanks david jencks > > > Regards, > Graham > --