Reputation: 15679
what is the name of the Design pattern. Simple example
public interface SomeObject{
public void call();
}
public UnknownDesignPatternImpl implements SomeObject(
List<SomeObject> objects;
public UnknownDesignPatternImpl(List<SomeObject> objs){
objects = obj
}
public void call(){
for (SomeObject obj: objects){
obj.call();
}
}
}
it implements the same Interface but delegates calls to a List of interface objects
Upvotes: 2
Views: 97
Reputation: 1418
It could be very similiar to Command
References:
http://java.dzone.com/articles/design-patterns-command
Upvotes: 0
Reputation: 11117
It's called Composite
More information here:
http://java.dzone.com/articles/design-patterns-composite
Upvotes: 2
Reputation: 311163
This is an implementation of the Composite Design Pattern - an object implements an interface and delegates to a collection of other objects implementing the same interface.
Upvotes: 5
Reputation: 42176
Are you talking about the delegation pattern? http://en.wikipedia.org/wiki/Delegation_pattern
Upvotes: 1