Composite vs Decorator pattern?
I need to create a class derived from net.sourceforge.cruisecontrol.Publisher which contains a list of objects of that same interface class and just calls the function in one of the objects in the list depending on the input.
Ex. If it's trying to send an E-mail to people who prefer Text Only E-mails, it calls a Publisher class that sends in only Plain Text, otherwise it sends using the HTMLEmailPublisher class...
From the UML diagrams on these pages, I believe it's a Composite pattern that I'm talking about, but someone else seems to think it's a Decorator. Any thoughts on who is right?
Composite pattern - Wikipedia, the free encyclopedia
Decorator pattern - Wikipedia, the free encyclopedia