views:

126

answers:

3

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:-

ConcurrentMap<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);
            }
          });
+8  A: 

It is a Builder with a Fluent api

Gareth Davis
+1  A: 

I think it's kind of Builder.

Stas
+4  A: 

Builder and/or Fluent Interface

http://en.wikipedia.org/wiki/Fluent_interface

http://en.wikipedia.org/wiki/Builder_pattern

mindas