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 7075347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:09:59+00:00 2026-05-28T06:09:59+00:00

I current got a flow like this: The Repository gets injected with a Datasource

  • 0

I current got a flow like this:

The Repository gets injected with a Datasource. The ViewModel gets injected with the Repository.

Because there’s a constant flow of Items and Mutations (deletions, changes) that need to translate to the UI I don’t keep a collection of items in the Repository. Therefor I ended up with a repository that only passes along Items between the Datasource and the ViewModels.

I’ve always understood that you shouldn’t directly use the Datasource in the UI layer (ViewModels are in my UI layer). But is this still the case if you use dependency injection? Am I putting the Repository pattern to its use or is it just causing me overhead? (Right now it feels like it does.)

I originally implemented the repository to decouple the UI and Datasource but I’ve found that DI does a great job without a Repository.

  • 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-28T06:10:00+00:00Added an answer on May 28, 2026 at 6:10 am

    You might want to have a look at some of the blog posts by Oren Eini (aka Ayende Rahien)

    The evils of the repository abstraction layer

    or

    Repository is the new singleton

    More often than not repositories are just “flow heaters”. They do nothing but forward calls and results and just add overhead.

    Btw: if you should or should not use repositories has nothing to do with dependency injection!


    Update

    Oren just published a new post on this topic.

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

Sidebar

Related Questions

I got a string that contains the current date by using this : NSString
I've got a model like this def upload_location(instance, filename): return 'validate/%s/builds/%s' % (get_current_user(), filename)
Basically I've got this current url and this other key that I want to
How to check current machine type? laptop or desktop ? I got this from
Ive got this current situation with an auction site. trada.net Somtimes they go offline
I have got this super weird bug in my current project. To understand what
I got this html <tr> <td> Main Alliase/Current Alliase: </td> <td><input type=text id=maina class=countchars
I asked for a 'work' permission and got this response.work array of all current
I got the below code from @DanS at this link how-to-display-a-map-still-image-file-with-a-moving-current-location onCurrentPosition(Location current){ double
I have not marked this question Answered yet. The current accepted answer got accepted

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.