N
N
nuhena2016-04-19 22:02:35
PHP
nuhena, 2016-04-19 22:02:35

What is the difference between a date mapper and a repository?

They seem to be doing the same thing. Or is the mapper a mixture of a repository and a factory?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Niomin, 2016-04-19
@Niomin

The Data Mapper is only responsible for the relationship between a table row and an object in memory.
Repository is responsible for fetching objects from the database. That is more of a search. Well or not from a DB. It's just a thing that can return a collection of objects from somewhere.

T
trevoga_su, 2016-04-20
@trevoga_su

design-pattern.ru/patterns/repository.html
frankly, it's garbage, not a pattern. type syntactic sugar + a collection of objects
I'm afraid, except for the author, no one will give an answer to this question. this is a very special case of a very vague pattern.

T
topot, 2016-04-19
@topot

If it's quite simple, then the
Repository is a repository of information (DB, files, ...)
DataMapper is the one who knows how to translate this information into objects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question