On Sunday 24 March 2002 16:42 pm, stephan beal wrote: > On Sunday 24 March 2002 04:55 am, Adam Murdoch wrote: > > The difference is mainly in where the object gets instantiated. For an > > addX() method, Ant instantiates it. For a createX() method, the > > task/type instantiates it. > > Is implementing both createX() and addX() considered evil (or just bad > style)?
errr, nevermind. implementing both, createX() is ignored. :( To me the following behaviour would make sense: 1) Ant calls createX() to get object foo 2) Ant calls addX( foo ) 3) Ant configures foo from <xml_element> To make a simple change to Adam's description: > Here's how a <foo> element is handled using an addFoo( Type arg ) method: > > - Create a new instance of Type, using the no-args constructor. Change this step to: - Create new instance using createFoo(), if available, else using default constructor. The rest would run as it has always run. Since nobody can rely on current behaviours here (there can be none - createX() is ignored if addX() exists), it would be 100% backwards compatible, and would give the object designer a tad more flexibility. i can't imagine exactly what he'd DO with the flexibility, but it'd be there. ----- stephan Generic Universal Computer Guy [EMAIL PROTECTED] - http://www.einsurance.de Office: +49 (89) �552 92 862 Handy: �+49 (179) 211 97 67 Student: "Master, you must teach me the way of liberation!" Master: "Tell me who it is that binds you." Student: "No one binds me!" Master: "Then why do you seek liberation?" -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
