Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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);
            }
          });
like image 996
Emil Avatar asked Oct 01 '10 09:10

Emil


People also ask

What is Data Mapper design pattern?

The Data Mapper Pattern is an architectural pattern introduced by Martin Fowler in his book Patterns of Enterprise Application Architecture. A Data Mapper is a type of Data Access Layer that performs bi-directional transfer of data between objects in memory and persistent storage.

What is data mapper in Java?

A Data Mapper is a Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in-memory data representation (the domain layer).

What is a mapper programming?

A mapper in computer programming deals with databases–extracting data and providing analytical, evidence-based insights to help business improve operational efficiency.

What is data mapper in repository?

a Repository acts like a collection of domain objects, with powerful querying capabilities (Evans, DDD) a DataMapper "moves data between objects and a database while keeping them independent of each other and the mapper itself" (Fowler, PoEAA)


2 Answers

It is a Builder with a Fluent api

like image 110
Gareth Davis Avatar answered Sep 26 '22 02:09

Gareth Davis


Builder and/or Fluent Interface

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

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

like image 23
mindas Avatar answered Sep 25 '22 02:09

mindas