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);
}
});
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.
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).
A mapper in computer programming deals with databases–extracting data and providing analytical, evidence-based insights to help business improve operational efficiency.
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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With