On Fri, 22 Feb 2002 05:05, Jose Alberto Fernandez wrote: > Now, no one is advocating defining new interfaces for > each and every method you want to allow overloading. > That would not work because you not only need to add > the interface to the Container, but you also have to > declare the objects as belonging to the role defined > by the interface. By the same token, in Peter's world, > for every type (i.e., data-type) you declare you would > have to declare a "role" for that type and add every > data-type that is a subclass will have to be > registered as belonging to the role.
You only have to defines for a group of components if you want to treat that group of components as a separate group. Most of the current myrmidon components that are usable in build file extend DataType. However things like Condition won't. > This is definetly not the way to go for polymorphism. Polymorphism is not what roles achieve. It can achieve that and does do it in some cases (ie Condition objects) but in other cases theres no polymorphism in site - ie Path objects and friends that just implement DataType. > Finally, roles are not only for adding nested > elements. They are to register functionality. For > example I would like to have a "javac" role in which > libraries can register CompilerAdapters. +1 > A much more XML friendly way would be to let the > element describe the type and the attribute describe > the method to use: > > <diff> > <zipfileset ant:as="fromFS" dir="htdocs/manual" > prefix="docs/user-guide"/> > <classfileset ant:as="toFS" dir="build/classes"> > <root classname="org.apache.tools.ant.Main"/> > </classfileset> > </diff> Thats more workable but still a lil ugly ;) -- Cheers, Pete *------------------------------------------------------* | "Nearly all men can stand adversity, but if you want | | to test a man's character, give him power." | | -Abraham Lincoln | *------------------------------------------------------* -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
