ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuiper, Arnout" <>
Subject RE: Ant Principles (Design pattern)
Date Fri, 21 Apr 2000 09:32:31 GMT
> 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()

My Hfl. 0,02


View raw message