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

  • SEARCH
  • Home
  • 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 3276472
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:15:42+00:00 2026-05-17T19:15:42+00:00

I’m not sure how to name data store classes when designing a program’s data

  • 0

I’m not sure how to name data store classes when designing a program’s data access layer (DAL).

(By data store class, I mean a class that is responsible to read a persisted object into memory, or to persist an in-memory object.)

It seems reasonable to name a data store class according to two things:

  • what kinds of objects it handles;
  • whether it loads and/or persists such objects.

⇒ A class that loads Banana objects might be called e.g. BananaSource.

I don’t know how to go about the second point (ie. the Source bit in the example). I’ve seen different nouns apparently used for just that purpose:

  • repository: this sounds very general. Does this denote something read-/write-accessible?
  • store: this sounds like something that potentially allows write access.
  • context: sounds very abstract. I’ve seen this with LINQ and object-relational mappers (ORMs).
    P.S. (several months later): This is probably appropriate for containers that contain “active” or otherwise supervised objects (the Unit of Work pattern comes to mind).
  • retriever: sounds like something read-only.
  • source & sink: probably not appropriate for object persistence; a better fit with data streams?
  • reader / writer: quite clear in its intention, but sounds too technical to me.

Are these names arbitrary, or are there widely accepted meanings / semantic differences behind each? More specifically, I wonder:

  • What names would be appropriate for read-only data stores?
  • What names would be appropriate for write-only data stores?
  • What names would be appropriate for mostly read-only data stores that are occasionally updated?
  • What names would be appropriate for mostly write-only data stores that are occasionally read?
  • Does one name fit all scenarios equally well?
  • 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-05-17T19:15:42+00:00Added an answer on May 17, 2026 at 7:15 pm

    As noone has yet answered the question, I’ll post on what I have decided in the meantime.

    Just for the record, I have pretty much decided on calling most data store classes repositories. First, it appears to be the most neutral, non-technical term from the list I suggested, and it seems to be well in line with the Repository pattern.

    Generally, “repository” seems to fit well where data retrieval/persistence interfaces are something similar to the following:

    public interface IRepository<TResource, TId>
    {
        int Count { get; }
        TResource GetById(TId id);
        IEnumerable<TResource> GetManyBySomeCriteria(...);
        TId Add(TResource resource);
        void Remove(TId id);
        void Remove(TResource resource);
        ...
    }
    

    Another term I have decided on using is provider, which I’ll be preferring over “repository” whenever objects are generated on-the-fly instead of being retrieved from a persistence store, or when access to a persistence store happens in a purely read-only manner. (Factory would also be appropriate, but sounds more technical, and I have decided against technical terms for most uses.)

    P.S.: Some time has gone by since writing this answer, and I’ve had several opportunities at work to review someone else’s code. One term I’ve thus added to my vocabulary is Service, which I am reserving for SOA scenarios: I might publish a FooService that is backed by a private Foo repository or provider. The “service” is basically just a thin public-facing layer above these that takes care of things like authentication, authorization, or aggregating / batching DTOs for proper “chunkiness” of service responses.

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

Sidebar

Related Questions

No related questions found

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.