> From: Kuiper, Arnout > So in short, > > void setXxxx(<ObjectType> value); // attributes > void addXxxx(<ObjectType> value); // entities > void addText(String value); // text > > still holds.
Don't get me wrong here, I also like the way Sam did it: Object createXxxxx(); // entities I just wanted to show that the other way still works, for an honest comparison. So let's see where the two proposals differ: Object createXxxxx() has the following points when compared with void addXxxx(<ObjectType> value). + Object is created inside task, so no need to find the correct type in some intelligent way. This makes the creation a lot faster, and might prevent classloader problems. + No conflict with the addText(String) method - When the task is encapsulated, you cannot add an existing object of the correct type. You have to create a new one with createXxxx to add it, and fill the fields. After making this comparison, I tend a bit to the createXxxx() method. My Hfl. 0,02 Arnout
