I have an interface thus:
public interface Doer
{
public void do(Object arg);
}
And I have an implementation that keeps a list of Doers
, and does whatever on each:
public class DoerCollectionThing
implements Doer
{
private List<Doer> doers....
public void addDoer(Doer d)
{
doers.add(d);
}
public void do(Object arg)
{
for (Doer d : doers){
d.do(arg);
}
}
}
So, what do I call DoerCollectionThing
? Is it a DoerAggregator
? Or maybe DoerCollectionDoer
? What do you all use for this type of thing?
The correct name for this is a Composite
, because you're composing many implementations of an interface together into a single object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With