Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [repository]

A repository provides a storage mechanism for digital products. May refer to [version-control] like [git] or [svn]. An application specific tag should be used with this tag in order to identify the specific repository management interface that is being used unless the question is general in nature. See also: [repository-pattern]

104
votes
5answers
39k views

Why do people fork repositories on GitHub? [closed]

I noticed that a lot of GitHub accounts only have repositories which are forked from other accounts. In addition the people who do this usually don't make any contributions to the forked repositories. ...
73
votes
8answers
129k views

Using multiple Git repositories instead of a single one containing many apps from different teams? [duplicate]

I am migrating a 10-years-old big CVS repository to Git. It seemed obvious to split this multiple-projects repository into several Git ones. But the decision-makers are used to CVS, therefore their ...
27
votes
2answers
15k views

is it bad practice that controller call repository instead of service?

is it bad practice that controller call repository instead of service? to explain more: I figure out that in good design controllers call service and service use repository. but sometimes in ...
20
votes
4answers
5k views

When to use repository pattern

I have read recently that it is not good practice to use the repository pattern in conjunction with an ORM. From my understanding this is because the abstraction they provide over the SQL database is ...
14
votes
1answer
5k views

Are we using the repository pattern right?

We are using a bunch of separate classes suffixed with -repository to retrieve the data from the database; for each table its own repository. We have for instance a customerrepository class which has ...
12
votes
4answers
7k views

Accessing Repositories from Domain

Say we have a task logging system, when a task is logged, the user specifies a category and the task defaults to a status of 'Outstanding'. Assume in this instance that Category and Status have to be ...
11
votes
1answer
717 views

When making a fix to an earlier commit, should I rebase or add a separate fix up commit?

A common scenario in software development is code reviewing somebody else's code. A common tool for doing this is opening a Pull Request. My question is, when issues are found in the review, should ...
11
votes
1answer
9k views

GitHub Organizations for a project spanning multiple repositories?

I've started a project that involves at least three repositories on GitHub. One of the repositories is a generic documentation-and-examples dump, and the other two contain the implementation of two ...
11
votes
2answers
7k views

What should a repository really do?

I've heard a lot of the repository pattern, but I quite didn't understand what a repository should really do. When I say "what a repository should really do" I'm mainly concerned about which methods ...
11
votes
1answer
6k views

How Add/Create* commands should be handled in CQRS + Event Sourcing architecture

I want to implement my first application using CQRS pattern along with Event Sourcing. I am wondering how creation of aggregate roots should be handled properly. Let's say someone sends CreateItem ...
10
votes
2answers
5k views

TDD with repository pattern

In my new project, I decided to try with TDD. And in very beginning I encountered a problem. First thing that I want to do in my application is to give ability to read data from data source. For this ...
10
votes
3answers
3k views

Are Repositories needed any longer in ASP.net 5 & EF7?

I posted a question on github to the EF Team. I got a reply saying it would be better to ask this question here so I will copy and paste it here as we as a link so other can see the few replies on ...
9
votes
3answers
529 views

Storing editable site content?

We have a Django-based website for which we wanted to make some of the content (text, and business logic such as pricing plans) easily editable in-house, and so we decided to store it outside the ...
9
votes
2answers
1k views

To Repository Or Not To Repository

When I first learnt about Domain Driven Design, I was also introduced to the repository and unit of work patterns that once seemed to be top notch for the cool kids that threw SQL queries like ...
8
votes
2answers
148 views

How viable is it to have a single webapp over several private small repositories?

We are a low budget team working on a web app. Due some complications we might need to work remotely from January and onward. After some consulting and googling, we concluded that several small ...
7
votes
3answers
1k views

What data type should Gateway return in Repository Pattern to eliminate refactoring when switching persistence mechanisms?

Following this description of the Repository Pattern, we have three main concerns that need their own classes: The "Repository," which takes and returns Domain Models. The "Gateway," which takes data ...
7
votes
2answers
1k views

To depend on source code or on binary?

We have two in-house projects, A and B, developed by different teams with B dependent on A. Since source code for both projects is stored in git, I've included project A as a submodule into project B ...
7
votes
3answers
479 views

Repository Pattern vs DAL Object Creation

As far as I've learned, the IRepository should contain CRUD. Then we inherit this IRepository in our other Interfaces like IProductand implement IProductconcrete class ProductRepository, with methods ...
7
votes
1answer
4k views

Repository Pattern and database queries

Having read others posts, it already seems to me that the concept "repository" and "database" do not go well hand in hand, as they are meant to be completely separate concepts.... but I'll ask the ...
7
votes
4answers
551 views

What's best practice when putting an abstraction layer over an ORM?

When working with an ORM such as Entity Framework, I've fallen into a comfortable habit. Make an interface with get/add methods on it, put this on a "Repository" class then add a constructor to each ...
7
votes
2answers
10k views

Repository pattern vs DAO managing Entities

I am new to concepts like DAO, DAL and Domain Driven Design. In the end I want to decouple the persistence layer (mysql database) from my business objects and logic in a web application. I liked the ...
7
votes
3answers
2k views

Is it good to split big repository into smaller ones to have separate history/issue etc or keep it big? [duplicate]

We are currently porting our huge svn repo to git and we are thinking to export subdirectories of repository, each one containing source code of independent binaries, documentation or robot tests, ...
6
votes
4answers
250 views

Storing directly in the model

Normally when I have some data to store, I do something like Model model = new Model(); Notifier notifier = new EventBus(); Store store = new DataStore(); model.updateTitle("new title"); store.save(...
6
votes
2answers
1k views

Is this a valid implementation of the repository pattern?

I've been reading up about the repository pattern, with a view to implementing it in my own application. Almost all examples I've found on the internet use some kind of existing framework rather than ...
6
votes
1answer
4k views

What is the difference between Repository Pattern and Facades Pattern?

I've always used the repository pattern in my applications. But I have seen that many people use facades instead of the repository for naming convention, but the operation is the same, I Think. Why is ...
6
votes
1answer
7k views

Repository Pattern: Exposing Data Context to Underlying Layers

My team is in the process of updating a legacy project. We've decided to incorporate the Repository Pattern along with Entity Framework in our Data Access layer. Below is a high-level view of this ...
6
votes
1answer
994 views

shared CD (Continuous Deployment) for multiple Git repositories

Long story short What is the best way to design a shared CD for multiple Git repositories (frontend and backend)? I'm struggling to find the best design for our CD. The hole picture (The details ...
6
votes
2answers
1k views

How to populate Lazy object from database

I have these classes: public class Order { private Lazy<IEnumerable<Volume>> _volumes; long ID { get; private set; } string Description { get; private set; } IEnumerable&...
5
votes
2answers
2k views

Should unit test be in separated repository?

Should I put unit testing stuffs in a separate repository, not in the same repository as the programming library? So I reference the programming library as submodule. But most open source projects ...
5
votes
4answers
649 views

How do you get into the habit of using a repository (e.g. GitHub)?

Are there some best practices on the repository front, or some common newcomer-traps that I should avoid? I have recently been reading about the benefits of repositories even for single-developer ...
5
votes
1answer
458 views

Using SQL for DDD Persistence - Is Referential Integrity Mandatory?

I am writing DDD bounded contexts with some entities using event sourcing for their persistence and other entities using SQL databases. To simplify writing of the entities that use SQL persistence, ...
5
votes
2answers
1k views

In MVP, should we call repositories from the Model or the Presenter?

Note: The example in this question is for demonstration. Please focus on the question and not on problems in the example (such as tight coupling, lack of Dependency Injection etc.). I have a form to ...
5
votes
3answers
255 views

Repository pattern, different identifiers

TLDR; I have one repo interface and multiple data sources, each with a different data identifier - how can I maintain having only one method in my interface? I have a need to read a domain object ...
5
votes
1answer
4k views

What is the purpose of domain/business logic in classes when having repositories?

From my experience I think that having classes/models without behaviour only in my application, next to their repositories is not good OOP. But, this was the way I implemented the repository pattern. ...
5
votes
2answers
335 views

Converting a very large remote subversion repository to a slimmed down Git repository

I have the pleasure of taking over 14 year old subversion repository that consists of two key elements: 111,000 revisions, about 10% of which are substantial; The repository dump is about 73 GB, ...
5
votes
2answers
1k views

Git clone to memory

I'm making an app that is required to clone git repositories by a link to it and analyze the codebase. Pulling to the disk using the git clone command wouldn't scale well. Is there any way to clone ...
5
votes
3answers
1k views

How granular should we get with repositories?

Is it better to have a repository per model (this could be a class that represents a table from the database) or should just have one big repository for all data access methods? I have done the ...
5
votes
2answers
2k views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
5
votes
2answers
2k views

Considering JCR as a NoSQL solution?

I'm evaluating some NoSQL solutions for a project of mine and JCR popped up during my searches as a document store. But it seems somehow of an obscure niche which didn't have the impact its designers ...
5
votes
2answers
2k views

monorepo - Single monorepo for multiple large-scale, company-sized projects

I'm in need of some advice before going foward. I want to build several large scale projects, like a marketplace product, and a few domain-specific products and libraries. The products may or may not ...
5
votes
3answers
255 views

How to notify a repository about persistence changes

I have a repository, which at the moment, reads from the database every time it is called. However, the data is only updated once a day, and to improve performance, I'd like the repository to store ...
5
votes
1answer
481 views

How to design a repository pattern that can handle per-use-case relational data loading?

We're designing a major refactor in my company system's codebase. One of the refactor points, is the (actual) definition of the business logic/domain model. Right now, every repository in the codebase ...
5
votes
2answers
830 views

Should repository have a method for every specific database operation?

When following the standard service and repository patterns, should your repository contain a specific method for every database operation or should you just use the general methods, e.g. update? Take ...
5
votes
2answers
227 views

Save Two Different Domain Objects in One Service Call

Think that when one Branch saved, a Customer entity must created in n tier layered system architecture. All validation has already implemented in CustomerService. Should BranchService create ...
5
votes
1answer
4k views

Confused on how to properly employ a Repository Pattern with Service/Business Layer on top

I'm building a ASP.NET Web Api 2 solution for learning purposes, and I've hit a snag. I was wondering if anyone could tell me what exactly it is that I'm missing. My Web Api solution has 4 Layers: ...
4
votes
2answers
2k views

How do you apply Single Responsibility principle to a repository

I am trying to apply "SOLID" whenever I can and try to use common sense and avoid a pattern when I see that a pattern is creating more problems than it's trying to solve. I don't want to apply a ...
4
votes
3answers
862 views

How do I describe the Repository pattern?

I'm currently working on the project with the new team and they are using Repository pattern which is new to me. In this repository, they're currently doing 1.If we are offline, we will load data ...
4
votes
1answer
795 views

How does the Aggregate Root concept and the Repository Pattern solve DRY in database operations?

If I have ten classes, and they all need CRUD operations, how does an Aggregate Root and the Repository Pattern solve me having to write lots of boilerplate code (the DRY)? Take the example of a ...
4
votes
1answer
155 views

Hide authentication information on Github

When your creating a project that has some sort of information that needs to be private (authentication details, etc), but you want to use some public repo like Github, are there anything that can be ...
4
votes
1answer
408 views

Should unit of work create repository?

Our "unit of work" class has a method which takes a class type and creates a repository: public IRepository<TEntity> GetRepository<TEntity>() where TEntity : class { ...