> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > .duncan wrote: > > Good point about using addXXX instead of setXXX due to multiple > > elements. > > Sigh. The currently implemented design pattern is: > void setXxxx(String value); // attributes > Object createXxxxx(); // entities > void addText(String value); // text > > The current proposal (as near as I can follow) is: > void setXxxx(String value); // attributes > void addXxxx(<ObjectType> value);// entities > void ???Text(String value); // text
I thought there was some consensus that attributes were tried to be casted intelligently, so setXxxx should be: void setXxxx(<ObjectType> value); // attributes where the String value of the attribute is tried to be casted to <ObjectType> (by using a constructor accepting a String, etc). Note that <ObjectType> in the setXxxx case might be a primitive type. I also prefer the "addText(String value)" method over the "setText(String value)" because of the separate text chunks. It's up to the task to decide whether it wants it as a whole (just use StringBuffer.append() in addText) or as separate chunks. Arnout
