MapMaker Design Pattern?
I was impressed by google's MapMaker design.I would like to know what is the name of the pattern that is used here ?
( What i think is it's somewhat like decorator pattern but in which we don't have to wrap the object in other object to extend the functionality,but I can't figure out exactly what sort of pattern it is. )
MapMaker Object Creation:-
Conc开发者_JAVA百科urrentMap<Key, Graph> graphs = new MapMaker()
.concurrencyLevel(32)
.softKeys()
.weakValues()
.expiration(30, TimeUnit.MINUTES)
.makeComputingMap(
new Function<Key, Graph>() {
public Graph apply(Key key) {
return createExpensiveGraph(key);
}
});
It is a Builder with a Fluent api
Builder and/or Fluent Interface
http://en.wikipedia.org/wiki/Fluent_interface
http://en.wikipedia.org/wiki/Builder_pattern
I think it's kind of Builder.
精彩评论