Stack Exchange Network

Stack Exchange network consists of 175 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]

0
votes
1answer
38 views

DDD accessing reference values in Domain layer without repositories

So I have built a domain model and some logic into that. I have created two repositories for two aggregate roots. My question is how to access to the reference data from these layers?. For example, ...
1
vote
4answers
174 views

Object Oriented Design: Repositories and Inheritance

I have an OO design concern. Let's say my models as following: class Account {} class LocalAccount extends Account {} class SocialAccount extends Account {} These Account entities are persisted and ...
3
votes
1answer
96 views

Which should I prefer: A subrepository/submodule, or a CMake ExternalProject?

I'm developing or maintaining a free software project Foo which uses CMake for a build system, as well as source control (e.g. Mercurial or Git), with the repository being available online. Now, this ...
2
votes
1answer
192 views

How do I work on a new project and simultaneously add generic code to a base library with version control?

I work on several projects and sometimes they share a common base. How do you work with version control? Here's an example: I've got a boilerplate Wordpress plugin that I reuse. On each new ...
0
votes
0answers
24 views

Code base architecture for one app that has multiple versions with small changes [duplicate]

I'm building a hybrid mobile app that has slightly different versions but share 99.9% of the code. There is a paid and free version, which differ in one function only. Also there is a slight ...
4
votes
3answers
114 views

Is a repository return a graph of entities violating SRP?

I'm working in this scenario Post entity has many Image entities. I also have repository to both entities: PostRepository ImageRepository Since this entities are tightly related, when I get a Post ...
2
votes
1answer
132 views

How to structure microservices in your repository

I am assigned to a project where we have about 20 micro-services. Each of them is in a separate repository without any references to any other, apart from one Nuget package where we maintain some ...
1
vote
2answers
101 views

Unit and integration testing of microservice architecture

I am investigating how to test a project. Some information about the project: Microservice architecture, with roughly 20 services. About 10 of them with a separate database. We use ServiceFabric ...
1
vote
0answers
56 views

Multi module Maven project or separate repositories?

Consider the following architecture: Application A Application B Commons-Util A and B share a lot of functionality. That's why we plan to extract the shared code into a commons library. I am aware ...
-1
votes
2answers
42 views

Logic to create/update values while maintaining their uniqueness (in a multi-threaded environment)

Assume I have a dumb repository which stores numbers (for sake of this example). It is dumb because it may only create new record, update specified record and list all the existing records - no other ...
0
votes
1answer
83 views

Private class in ORM Repository?

Is this a code smell? I have a repository which connects to a SQL server. This repository uses Dapper to map the results to an object. I have a method in this repository that checks a result, then ...
0
votes
2answers
123 views

DDD: repository for a nested entity?

I have a AR called User, which has among other entities one called City. The way I assign a City to a User is: $user->addCity($city); The problem comes when a id is given at some Controller ...
4
votes
1answer
147 views

What tactics to use to load the referenced data in repository implementation?

Say that I have a repository that is used as READ-ONLY data provides (never for the writes/updates) - the query part of the CQS, NO event sourcing, hitting relational DB. One of the essential rules - ...
1
vote
0answers
62 views

Should a UnitOfWork contain every Repository?

I'm trying to get the Repository/UnitOfWork pattern figured out. We're working on a project with EntityFramework and our DBContext contains 200+ tables. Right now our approach is to inject whatever ...
2
votes
2answers
152 views

Is it better to have a single query that returns all related entities, or separate queries for each case?

Summary When writing methods to query for related entities, is it better to have a single method for all related entities or separate methods for each combination? Full Problem I'm writing ...
5
votes
2answers
433 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, ...
0
votes
2answers
73 views

Is it a good idea to let database surrogate key values spill out into other aspects of code (HTML, Controllers, Model, Repository layer)?

Is it acceptable to use id in HTML forms and subsequent code processing (controller, view, model, repository layers)? For example I need to show something like this on a web page: Select Motor ...
8
votes
3answers
850 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 ...
1
vote
0answers
56 views

How can I offload customer's data needs onto the customer?

I write code for an Engineering application where engineers keep giving me various specs in a form of tabular data - for example, a table with product model names and many various parameters for each ...
3
votes
2answers
232 views

Should I nest repositories like Russian dolls?

tl;dr Can I have a repository depend on another repository, where they both implement the same interface? I am working on a website analytics system that involves getting data from different sources. ...
-1
votes
1answer
39 views

how to merge or update a template repository?

I have a template repository consisting of a folder structure, scripts, makefiles, example files (text templates) etc. The easiest way would be to clone the repo, delete the .git folder and create a ...
4
votes
2answers
2k views

Repositories, Gateways, Models and Architecture Questions

I am working with a Laravel project and I am looking for a way to solve the issue of bloated models and cross referencing between them. I had started extracting higher level methods to a repository ...
2
votes
1answer
969 views

What is the difference between a Query Object and a Repository?

What is the difference between Query Object and Repository? Martin Fowler 'Patterns of Enterprise Architecture': “an object that represents a database query.”, Also should a QueryObject always be ...
2
votes
2answers
439 views

What data should a repository return

I have a simple project where the controller calls the service, and the service calls the repository in order to get the needed data. Assuming that we have these domain models: // this model has a ...
0
votes
1answer
117 views

Can source code, automake and configure files for multiple OS co-exist in one Git branch

I am working on an open source project that should be compiled for multiple operating systems including Ubuntu and Windows. I am working on how to structure the Git repositories and branches for ...
1
vote
1answer
68 views

Handling generic and specific implementation

Normally we have some code that is common for many (if not all) derived classes. An example would be a generic repository (where I could have a generic Add, Remove, Count, Max, Load etc, or a generic ...
4
votes
1answer
480 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 { ...
0
votes
1answer
148 views

Swapping Entities or ORM in repository pattern

Lets say i am following Repository pattern in my application and i have class UserEntity { private $model; public function __construct() { $this->model = new UserModel(); } }...
3
votes
3answers
243 views

How can database-specific functionality, such as increment/decrement features, be used in DDD?

I have an entity that has a dollar balance property. Whenever an event occurs that causes the balance to change, such as a debit, within the same transaction the balance should be decremented by the ...
1
vote
2answers
378 views

Where to place POCOs validation - N-layers architecture

I am developing an n-layer app. One of the layer is the BusinessLayer and consumes a set of POCOs defined in the CoreLayer. Also I have a PresentationLayer (WinForms) CoreLayer POCOs (classes with ...
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 ...
1
vote
2answers
96 views

Making utilities discoverable

I am currently working a data science team, and we write small utilities all the time to consolidate data, extract data, etc (an example is go through a folder of excel workbooks, convert all the ...
3
votes
3answers
916 views

Calling service and repository layer from controller

A question came to the team and I'm asking you guys. Our application uses MVC with service layer. But sometimes our service layer just call the repository, without doing nothing Our questions is: in ...
2
votes
1answer
507 views

git: multiple repositories but still “grouped”

I have a rather simple application which consists of an angular frontend and a REST API done in C# For the frontend I use WebStorm and for the backend Visual Studio. Now we need to introduce a new ...
4
votes
1answer
2k views

Decoupled architecture in Android

I am building an app for Android that will have multiple data sources depending on who is using it. N-tier architecture with a repository pattern seems like the right way to go about this but I am ...
-3
votes
2answers
191 views

Source control with multiple customer-specific repositories

Here is a diagram of how our source control setup is configured. The issue with this setup is how we handle various customers. I would really like to use a different approach than copying the entire ...
0
votes
1answer
72 views

How to handle pull requests merges in a service oriented environment that touch several repositories?

So we have a microservices architecture. Quite often we release features that require changes in several repos simultaneously. What approaches are best for handling this? Ex. Pull Request 1 from ...
0
votes
0answers
42 views

Repository Unit of Work object type reference

I'm confused on how to best use this pattern. I have a project that uses Devart's Entity Framework for Oracle. The context is provided by them. So I have an interface IRepository and a single ...
2
votes
2answers
244 views

Workflow for chains of dependent pull requests to projects that depend on other projects

Suppose you have project A and project B, where project B depends on project A - let's say A is a library. And project A and project B live in separate version control repositories - either because ...
4
votes
1answer
59 views

Organizing Ad-Hoc Tooling in a Muti-Repo Structure

Imagine you have the following scenario. Your organization deploys some app core to its mission. For example if you're Stack Exchange, this might be the customer facing web server. Let's also say you ...
0
votes
2answers
113 views

Should I create a Repository Container to get my repositories?

@Component public class RepositoryContainer { @Autowired public CommentRepository commentRepository; @Autowired public ItemRepository itemRepository; @Autowired public ...
2
votes
2answers
626 views

Object To Be Used By Service Layer

My project has a UI layer, a Service Layer and a Repository layer. The latter has Entity objects as part of the ORM (.net Entity Framework). The service later returns a Dto to the UI layer. My ...
3
votes
2answers
267 views

Are you supposed to fork a repo if you're porting it to another language?

I'm new to forking and open source and I'm porting a Rust library into Swift but I wasn't sure if I needed to fork the original repo and then replace it with my new files or just upload my own repo ...
1
vote
4answers
222 views

Use OOP approach for organize the business rules instead of SOA in a small project. Excluding DDD, is there some strategy to do this?

I was talking with a friend another day about OOP in small projects. In the most of projects that me and him worked the SOA was the rule. Per example, imagine a Order in a SOA application. The ...
5
votes
3answers
261 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 ...
6
votes
1answer
1k 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 ...
1
vote
0answers
283 views

Putting UnitofWork handler in the Request Model for DDD with Clean architecture?

I'm rearchitecting a system in Python, using SQLAlchemy for the data mapping layer, and the Zope Component Architecture for dependency injection and interface declaration. I am in the process of ...
0
votes
1answer
496 views

Two code bases in one repository… is there ever a good reason to do this?

I work on two code bases that are related, but independent. One is written in PHP, the other is Node JS. Currently, they are in a single repository. The repo is deployed to Heroku for the Node code, ...
1
vote
1answer
1k views

Service layer with DTO

I'm refactoring my desing to use a service layer - however I'm confused about how you would pass arguments, when it's only allowed to update certain fields of the entity. For instance I have some ...
3
votes
1answer
708 views

Domain Objects and How they Access the Database

Suppose I have the following class: public class Course { // data public string Name { get; } public List<Student> Students {get;} //... // logic public int ...