Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:38:42+00:00 2026-06-14T21:38:42+00:00

I found two patterns which appear to have the same goal – what is

  • 0

I found two patterns which appear to have the same goal – what is the difference?

http://martinfowler.com/eaaCatalog/dataMapper.html

http://martinfowler.com/eaaCatalog/repository.html

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:38:44+00:00Added an answer on June 14, 2026 at 9:38 pm

    [the Repository is] another layer of abstraction over the mapping
    layer where query construction code is concentrated.

    The DataMapper ensures the DB side of the fence doesn’t need to know about the specifics of your business logic and how the data is kept in memory by your business objects and your business side of the fence doesn’t need to know how the data is stored.

    To illustrate, consider that your data is kept in the DB as a set of rows, say each row represent an item in your store. On the in-memory side, you might want to keep that information not as a list of StoreItem but as two lists, one for items which are in stock and another for out-of-stock items.
    It would be the DataMapper‘s job to handle the transition between one list and two lists.

    You can complicate things by adding lists of other objects and inheritance on the business side of the fence. The ‘DataMapper’ would have to translate to and from that representation to the relational DB.

    The ‘Repository’ provides the “SELECT * FROM table WHERE condition” functionality to the business side. You provide a filter and it will return a collection of objects that matches that filter.

    In short: the ‘DataMapper’ deals with single objects, the ‘Repository’ deals with collections of objects and expands upon the functionality provided by the ‘DataMapper’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large set of string URL patterns like {http://www.imdb.com, http://www.amazon.com ,...}
Found two libraries Rebex ( www.rebex.net ) and QuikSoft ( www.quiksoft.com ) any comments
I have found two different things in two well known books in c, first
I have found two ways to extract matches in Python: 1. def extract_matches(regexp, text):
I have two classes (A and B) which depend on each other in following
So I've found a great deal on deleting the text between two patterns and
I already have two filters, which typically checks for a valid session. If session
I have to replace text with text which was found. Smth like this: regex
I have two forms. One of which has two fields, the name field, and
Upon some research I found two functions in MATLAB to do the task: cvpartition

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.