From dev-return-49359-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Sun Aug 10 23:20:57 2003 Return-Path: Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 9749 invoked by uid 500); 10 Aug 2003 23:20:56 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 9734 invoked from network); 10 Aug 2003 23:20:55 -0000 Received: from main.gmane.org (80.91.224.249) by daedalus.apache.org with SMTP; 10 Aug 2003 23:20:55 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19lzVw-0006O2-00 for ; Mon, 11 Aug 2003 01:22:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@ant.apache.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19lzVv-0006Nu-00 for ; Mon, 11 Aug 2003 01:22:15 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19lzUd-0003js-00 for ; Mon, 11 Aug 2003 01:20:55 +0200 From: Nicola Ken Barozzi Subject: Re: override Date: Mon, 11 Aug 2003 01:18:56 +0200 Lines: 66 Message-ID: References: <747F247264ECE34CA60E323FEF0CCC0C0F5128@london.cellectivity.com> <3F34FAFB.9080906@asert.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en In-Reply-To: <3F34FAFB.9080906@asert.com.au> Sender: news X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Paul King wrote, On 09/08/2003 15.45: ... > For the conceptual model is one of textual inclusion > (or XML entity inclusion if you are that way inclined). > The ant way states (at least for properties) that whoever sets > things first "wins". I would argue that would be the simplest > model for everything else too (but there has been some talk of > failing the build if nameclashes occur). The trick in understanding is to put all these files in one file and run "ant". Ant now indeed works as you suggest, as multiple targets do not collide, but the first one wins. I would suggest that > whoever is first wins could apply to path references, targets etc. > Depending on my settings I will get a warning and arguably ant > could be run in a "strict" mode which could fail if a property, > path, target was adjusted later. The implication of this is > that even within the one file you could (though never recommended) > have two targets with the same name - the second would be ignored. Exactly what happens with the latest Ant CVS. But this, as Conor has shown, creates problems that are not easily understandable by users. The example was about all imported files having a target with the same name, and other targets depending on it. All imported files would then use the first decalred one in the first file, which may not be what was intended. > I have seen some of the import, super, override discussions > but can't see an easy conceptual model following ant's > similar but not exactly equivalent notion of inheritance. > So, what I want to achieve is the equivalent of Java's > delegation trick/pattern used to mimic multiple inheritance. > In Java I wouldn't use inheritance at all but would instead > have two instance variables (the delegates) and I would > pass any method calls on to the appropriate delegate. > > This is where things aren't clear to me. In the example > I have used two antref tags. I am trying to avoid the > nameclash issue altogether - conceptually I either have > some new targets but only full qualified and perhaps not > visible or I may need "target references" to some targets. > Now I can declare my own targets and refer to the original > targets in some fashion either by their fully-qualified names > or using the target reference. I have used a pseudo task > called targetref - kind of like super which has been discussed > before but perhaps I could use (an extended) antcall with a refid? > > Any suggestions? Does this help anyone? I don't think I follow you. It seems that you are describing how import works now, with first-target wins, and access to all the targets with "fully qualified" names. Look in CVS manual for the import task... is that what you mean? -- Nicola Ken Barozzi nicolaken@apache.org - verba volant, scripta manent - (discussions get forgotten, just code remains) --------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org