Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 87734 invoked from network); 8 Apr 2005 14:05:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Apr 2005 14:05:09 -0000 Received: (qmail 38088 invoked by uid 500); 8 Apr 2005 14:05:07 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 38043 invoked by uid 500); 8 Apr 2005 14:05:06 -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 38028 invoked by uid 99); 8 Apr 2005 14:05:06 -0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web30908.mail.mud.yahoo.com (HELO web30908.mail.mud.yahoo.com) (68.142.200.161) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 08 Apr 2005 07:05:04 -0700 Received: (qmail 5723 invoked by uid 60001); 8 Apr 2005 14:05:01 -0000 Message-ID: <20050408140501.5721.qmail@web30908.mail.mud.yahoo.com> Received: from [65.247.233.95] by web30908.mail.mud.yahoo.com via HTTP; Fri, 08 Apr 2005 07:05:00 PDT Date: Fri, 8 Apr 2005 07:05:00 -0700 (PDT) From: Matt Benson Subject: RE: ResourceCollections To: Ant Developers List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This was so well put-together I have little to add, though I will say that after having had time to absorb Peter's proposed alternative container, I am probably not as negative about about it as Dominique. The point that this type of fix would require maintenance however certainly seems valid. My only other question would be, what was the intent of reserving the "ant:*" namespace "protocol" in the first place? -Matt --- Dominique Devienne wrote: > > From: Peter Reilly [mailto:peterreilly@apache.org] > > I do not like "ant:mappers", etc > > I don't have much of a problem with it myself now. > It's been argued, winning me over, that the ant: > prefix > is already reserved, and thus it's an acceptable > solution > solution to this problem, and Matt idea of loading > role.xml > for ant: is elegant enough, no? > > > This does not use the method "antlib: name>" that antlibs > > are meant to be identified by. If "ant: core wants>" is > > used to identify ant's antlibs', then there is > ample reason for > > thirdparty antlibs authors to ask for "easy to > use" XML uri > > identifications for their antlibs. > > As I wrote earlier I also like the antlib: > convention. > That's what I proposed we used in the first place. > But others > think it's too verbose. Surely you can see where > they're coming > from Peter ;-) > > > For core ant types, I do not think it is a good > idea - the namespace > > syntax will "get in the way". > > Not really. Within Ant itself, you would never need > to specify > NS for mappers, selectors, etc... Because Ant types > using them, > instead of having one elegant add(FileSelector) > method, they have > tons of add(FileSelector). > > The need for namespaced types arises for 3rd party > which do use > the more elegant and extensible add(Type) methods! > > Use a namespace is tons more elegant than having to > explicitly > typedef each one you want to use like I had to do. > If you refuse > to add role-specific antlibs, then I'll have to > define them > myself in my custom AntLib, which clearly breaks > encapsulation. > > > For about a year now, new mappers, conditions, > selectors and filters > > have been added by making them typedefs. > > If so, why did I need to typedef the date and size > selectors > when I'm using Ant 1.6.2? > > > We should be able to make all the current > conditions, selectors and > > filters be typedefs. > > But then you're polluting the global namespace IMHO. > > Types where originally for elements that could stand > on their > own at the top level, or directly inside targets. > All these > new types you are defining in the global namespace > OTOH are > meant to be used only in a very narrow context, > within another > (real) type or task. > > > There are only a few name over-laps: > > and, or, not (selectors and conditions) > > > > Of course this will change with the selectors for > the > > new resource collections, - but it may be > possible to > > be clever. > > Precisely. We already have name conflicts, and it > will > only get worse. Namespaces are meant to resolve name > conflicts. Lets try to not get too clever trying to > implement another mechanism for this. > > > It is quite easy to write a type that is a > container for > > selectors and conditions (attached) that will act > as a > > container for selectors or for conditions. > > It's my turn to not like this. As you say, it's > clever, > but now you're writing code to disambiguate name > clashes, > and the more name clashes appear, the more you write > code... > > > So to summarize, you Peter don't need to use any > namespace > when using Ant roles, because you're likely to use > then in > the context of Ant types/tasks, which have > specialized add > or create method for them. > > I, otoh, but using the new flexible add(Type) > method, have > forced to use namespaced Ant roles (mapper, > selector), and > that's perfectly alright with me. > > It is my opinion that Ant roles should *NOT* be > added as > types (if some were, then for BC reason they can > stay that > way, but only if they appeared in an official > release), to > avoid polluting the global namespace. > > As a consequence, like I said in the first place, we > need to > define Role-specific AntLibs (and thus namespaces). > And I > personally don't care if we use ant: or > antlib:. > What I wanted in the first place, and still want > obviously, > is for these to be defined, so I don't have to > explicitly > typedef myself pre-defined Ant role impls in my > build script. > > If somehow we go your proposed put-them-all-as-types > route, > then I also won't have to typedef them explicitly, > which I > like, but we haven't resolved the name conflicts at > all. > And your proposed clever solution to this is not an > acceptable > solution to me (at this point). > > The ideal solution would be in fact to allow > registering > several classes/types under the same name, and the > Ant runtime > to pick the one type for which isA(Type) is true, > fort the Type > at hand, failing with an Ambiguous error if more > that one such > type exists. This way, you could register > AndSelector and > AndCondition with , and use the 1st in the > context of > add(FileSelector), and the 2nd when with an > add(Condition). > This doesn't eliminate all conflicts, as for example > your > ContainerConditionOrSelect has both, it would be > Ambiguous > still. > > To me, using role-specific AntLibs is simply the > only foul > proof solution to name conflicts, that fits the > existing > behavior of Ant. --DD > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > dev-unsubscribe@ant.apache.org > For additional commands, e-mail: > dev-help@ant.apache.org > > __________________________________ Yahoo! Messenger Show us what our next emoticon should look like. Join the fun. http://www.advision.webevents.yahoo.com/emoticontest --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org