Return-Path: Delivered-To: apmail-lucene-lucy-dev-archive@locus.apache.org Received: (qmail 62395 invoked from network); 21 Dec 2006 22:51:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Dec 2006 22:51:33 -0000 Received: (qmail 50797 invoked by uid 500); 21 Dec 2006 22:51:40 -0000 Delivered-To: apmail-lucene-lucy-dev-archive@lucene.apache.org Received: (qmail 50766 invoked by uid 500); 21 Dec 2006 22:51:40 -0000 Mailing-List: contact lucy-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@lucene.apache.org Delivered-To: mailing list lucy-dev@lucene.apache.org Received: (qmail 50757 invoked by uid 99); 21 Dec 2006 22:51:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 14:51:40 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dbalmain.ml@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 14:51:30 -0800 Received: by ug-out-1314.google.com with SMTP id k40so2884229ugc for ; Thu, 21 Dec 2006 14:51:09 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Yj1gAGyKb26j10ujQ6ldHfm+C9ofCVP25wGKq7DhOe+CFIYiXgy5cDeBIRy4Dd+FtcoGIBhT8HCA7p4IffHUSUJimFQWOkq+ETd7tlKwuOaHGf3/Wl0nWejIxR3LiI7q28phtTc3Xu4UnvzhjU9aj5GqLBvLabRSyKwfRuyuggM= Received: by 10.82.152.16 with SMTP id z16mr2016892bud.1166741469122; Thu, 21 Dec 2006 14:51:09 -0800 (PST) Received: by 10.82.167.11 with HTTP; Thu, 21 Dec 2006 14:51:09 -0800 (PST) Message-ID: Date: Fri, 22 Dec 2006 09:51:09 +1100 From: "David Balmain" To: lucy-dev@lucene.apache.org Subject: Re: OO Design -- initialization In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48066BF6-6AE9-4525-A345-B1C86790300C@rectangular.com> X-Virus-Checked: Checked by ClamAV on apache.org On 12/21/06, Marvin Humphrey wrote: > > On Dec 18, 2006, at 11:06 PM, David Balmain wrote: > > > Actually, I like this more than the code below. To me the braces help, > > not hinder. But to each his own I guess. Also, we could macrofy this > > if wanted to; > > > > #define DOG_DATA(name) {\ > > name,\ > > (Animal_speak_t) Dog_speak,\ > > (Animal_eat_t) Dog_eat\ > > },\ > > Dog_chase_cats > > > > /* in Animal/Dog.c */ > > const DOG DOG_CLASSDATA = { > > DOG_DATA("Animal::Dog") > > }; > > > > /* in Animal/Dog/PitBull.c */ > > const PIT_BULL PIT_BULL_CLASSDATA = { > > { > > DOG_DATA("Animal::Dog::PitBull") > > }, > > PitBull_chase_humans > > }; > > It turns out that we don't have to resort to manual intervention like > this at all. > > boilerplater.pl generates a model of the complete inheritance > hierarchy. Each class is represented by a Class object which knows > its parent, its children, its member variables, its class functions, > and its instance methods, including which methods are inherited or > overridden. > > With that information in hand, it's possible to resolve all inherited > members, both for the object struct defs and for the virtual table > struct defs. > > It might be a smidge faster. More importantly, it's oodles easier to > maintain and there's a lot less potential for error when this stuff > gets handled automatically. I thought this might be the case when I read your first email on boilerplate.pl. That all sounds perfect. > > complaint about ruby and valgrind unhappiness > > > This is one of the > > things that got me thinking about building a database like search > > engine which runs in a separate process to Ruby as a server, but that > > is a whole other story. > > If we allow the user to specify the serialization of Document, Lucy > becomes an object database. :) Yep, I've considered this. :) -- Dave Balmain http://www.davebalmain.com/