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]
263 questions
0
votes
2
answers
177
views
How could I map a complex DTO to a Domain Aggregate in a Repository?
I'm working on a TypeScript application designed with DDD and using layered architecture. My infra layer has a repository that fetches a complex, nested DTO. My current implementation maps this DTO ...
5
votes
3
answers
667
views
How to get rid of Mappers and make objects build themselves?
I am having a really hard time deciding where to instantiate my entities in the refactoring I am making. The project was built with DDD and it's layered: it has the infra, domain and app layers. In ...
2
votes
4
answers
347
views
Where, in a repository, should I put source code for tools used in the build only?
Suppose I have a repository for an application app_a. To build app_a, one needs to compile some sources (e.g. file1 and file2, never mind the file suffixes), but - it is also necessary to:
Apply some ...
5
votes
2
answers
1k
views
Repository and Service Interfaces in an Accounting Software in Go with Uncle Bob's Clean Architecture
I'm trying to get hands-on experience with Uncle Bob's Clean Architecture in Go, but I'm running into some issues. Also, I'm not yet familiar with all of Go's idioms.
For testing purposes, I'm ...
1
vote
2
answers
417
views
I'm confused how to structure my pom.xml when both Parent and Child modules are being developed simultaneously
Let's say I have the following maven projects.
UtilsLibrary -- A maven project containing utils.
AppA -- A maven project that depends on UtilsLibrary.
AppB -- A maven project that depends on ...
0
votes
1
answer
393
views
How to share transaction across multiple repositories in DDD?
We are trying the Domain Driven Development (DDD) while working on a project.
We've got a Product aggregate.
We've got a ProductRepository to load/save Products.
We've also got a Timeline aggregate, ...
0
votes
1
answer
317
views
Is IRepository allowed to know about database entities?
I am trying to apply Robert Martin's Clean Architecture on my .NET project. In one of chapters about boundary, it talks about that database interface should reside in business logic component rather ...
0
votes
2
answers
235
views
Is it a good idea to have a fork of a library's public repo in my solution?
My company's project uses an open source library, of which I have made a fork for some customizations. My idea is to clone this fork into my solution and to keep pushing my changes into it, as well as ...
1
vote
1
answer
870
views
Git Branching and Merging Strategy for Feature-Oriented Release Process
We have multiple developers contributing to a project, using Git as our repository. We have a QA branch that matches our QA environment and a master branch that matches production.
Features can be in ...
1
vote
2
answers
211
views
Specific get cases - Repository vs Service
I have a custom repository for each entity/module (I'm working with NestJS). I know that this is a lot of repeated code and I may refactor it in order to use a generic repository later, but currently ...
0
votes
2
answers
228
views
How should we set up our git structure?
this is a robotics team with some questions.
Here's our current setup, using GitLab:
Currently, we have a main branch as well as a separate branch for each of our programmers. When they want to start ...
0
votes
1
answer
101
views
Communicating unpredicted Failure from Repository implementation to Applicaiton Layer
My application follows Clean Architecture wherein the Application Layer wraps the Domain Layer. I try to adhere to DDD more-so as a "guiding light" than a strict rulebook.
Within the Domain ...
3
votes
3
answers
2k
views
How to implement Repository if only part of Entity properties are needed?
From many articles and answers on DDD Repository pattern, I got the feeling that a Repository should only CURD an Entity (Aggregate Root) as a whole.
Following this convention, we always need to query ...
-1
votes
1
answer
537
views
Right using monorepo for ts-node scripts
I have a repository with various tools/scripts written with ts-node and used in many projects.
Initially, it contained several automation/analytics scripts, one package.json file at the root, and one ...
3
votes
1
answer
307
views
Composite repositories: minimizing dependency injections
I have an application with dependency injection that consumes a REST API. The API calls are abstracted into entity-specific repositories. Some of the repositories are: HttpNotebookRepository, ...
1
vote
4
answers
381
views
Storing both a compiled service for a Docker container as well as the container in a repository. Good practice, bad practice or no precedent?
This has erupted from quite a turbulent meeting between two senior developers, a lead developer and an engineering lead, and after 90mins reached no resolution.
We create Spring Boot Java services ...
3
votes
2
answers
2k
views
Is it good design to have a repository update multiple entities?
I'm building a web application using Laravel. I use the repository pattern as my data layer.
Imagine there's some entity like Product and a product can be assigned to a ProductCategory.
The Product ...
1
vote
3
answers
487
views
Is there any value for a repository to return an iterator rather than a list?
I see a pattern where the get method from a repository returns an Iterable, even if the list is composed already:
def get() -> Iterable[type]:
my_list = [list]
for x in my_list:
yield x
I'...
-1
votes
1
answer
2k
views
Best practice for git repo locations
I started my first job as a dev about 3 months ago, at a very small company where I'm (currently) the only developer, and I've been setting them up with git. Their codebase is a bit all over the place,...
3
votes
1
answer
526
views
Should repositories return self persisting entities?
In domain driven design
A repository is a collection like "interface" that hides data source access. It furnish add, remove and retrieval method just like a collection would. It does it ...
5
votes
3
answers
1k
views
Are repositories async?
Repositories in ddd should give the illusion of an in memory
collection.
and
A Repository is essentially a facade for persistence that uses
Collection style semantics (Add, Update, Remove) to supply ...
-4
votes
2
answers
925
views
How can I use data from another remote repository without including it in my repository?
I currently have a CI workflow for tests that use data present in my repository. However, since this data is very large, I would like to move it to another remote repo and somehow give my CI tests ...
3
votes
1
answer
793
views
Releasing a project for multiple languages and package managers
My friend is building a small open-source project with a few convenience functions. He'd like to release both JS, PHP and Python versions of the package to npm, packagist and pypi. The main part of ...
0
votes
0
answers
280
views
Implementing the Repository/UnitOfWork pattern using Azure.Data.Tables "TableClient"
I currently have a generic Azure repository AzureRepository<TEntity> store internally a list of table transaction actions like so.
private readonly IList<TableTransactionAction> ...
1
vote
3
answers
988
views
Repository w/ MVVM Pattern: Data Format Check, Where/When, Best Practice?
TL; DR
Where/When to check data format in MVVM + Repository Pattern is the best practice? Any suggestion or theory?
The Scene
Our team is working on an Android Project. We have a MVVM+repo structure:
...
0
votes
6
answers
304
views
Is it necessary to understand the requirements of a change in order to perform an effective code review?
Can an effective code review be performed without first understanding the intent behind the code?
6
votes
3
answers
2k
views
Mixing server and client code in monorepo
To date, we have implemented a multi-repo approach in which each project, or for larger projects, each tier, has its own repo. Code is written in Typescript, Javascript, C#, PowerShell and T-SQL. ...
3
votes
1
answer
793
views
Setting up tests and a continuous integration pipeline in a polyrepo environment
In the past I've mainly worked with monorepos, specifically a Vue.js app that was served by a rails backend.
Setting up E2E/integration tests in the CI was simple, because all the required parts were ...
0
votes
1
answer
4k
views
How to organize multiple microservices in a GitHub repository?
I am setting up a Github repository for a project that will have multiple Microservices.
I have created a sub-directory for each microservice under One Repository.
ProjectRepository
\Services
...
0
votes
0
answers
155
views
How much should we archive for reproducible builds?
A few alternative twists on the question title to contextualize further:
What to archive of the "sources" for a given software build?
Should I include all transitive packages in my ...
2
votes
2
answers
3k
views
DDD - How to decouple two often used together aggregate roots
Context
I'm currently developing a notification system with DDD which needs to be able to send the same notification to multiple users. For example, a group of party goers might all be notified about ...
0
votes
3
answers
769
views
Are Git repository and software repository same things?
What I've read
A Git repository is the . git/ folder inside a project. This repository tracks all changes made to files in your project, building a history over time. (Source)
Repository: A collection ...
3
votes
2
answers
9k
views
Error handling for repository: exceptions or wrapping return value?
The question is about a desktop application I'm creating in C# and WPF.
As very common I'm using the repository pattern in my Data Access Layer for my CRUD operations. All data comes from the ...
11
votes
2
answers
15k
views
Should appsettings.Development.json be added to the repository?
Lately I got in a discussion with my colleague whether the appsettings.Development.json should be added to the git repository or not.
My considerations are: when a developer clones a repository to his ...
-3
votes
1
answer
1k
views
How to filter and add paging, if we must not expose IQueryable at Repository pattern?
In many discussion I learnt that was undesirable (forbidden) to expose IQueryable from Respository pattern.
What is the best practice then for server-side filtering and paging?
-4
votes
1
answer
61
views
Controlling and managing separate git repos on Azure DevOps for code security
My company is about to onboard some junior devs for the first time, and we want to limit their access to just the presentation layer. As it stands, everything is in one Git repo. The current plan is ...
2
votes
1
answer
248
views
How to model an action that involves more than one model?
I'd like to start by saying that I'm new to DDD and I'm creating a hobby system to practice some concepts, so this question might be trivial, but not so much for me.
I have the following scenario:
I ...
3
votes
1
answer
9k
views
Repository Pattern with Services Layer - Good Practice?
This is my first time I am using repository pattern and applying a layered architecture in a project. I have followed the article found here. The complete code found on the article can also be found ...
1
vote
1
answer
2k
views
DDD Aggregate in PHP — how to retrieve the root?
Status quo
I created an aggregate, let's call it Foo. It has two entities within itself, let's call them Foo & Bar.
You can mutate things by calling the aggregate's public methods. E.g. $foo->...
3
votes
5
answers
794
views
Should the Model be able to persist itself? When?
I might start by saying that I am aware that usually there's a Repository layer
bookRepository.persist(book)
that abstracts the interaction with the database, but something about using the model ...
-2
votes
2
answers
128
views
Software Architecture: Repository Data grabs all the Data
We have the current software pattern below.
Sql Server Db --> Repository --> Domain Layer---> Dto Layer
The Dto layer filters sensitive data, and brings only required domain data to client ...
-3
votes
1
answer
882
views
how to manage build and deployments from Multi repos using versions
Consider you have two repos A, B.
Let say repo A has some infrastructure code - not needed to be updated always-
but it has the code for the service we want to deploy as infra.
On the other hand, ...
-2
votes
6
answers
260
views
Why don't packages formally specify (and repositories verify) their contracts
So, most software depends upon third-party libraries, to some extent or another. Specifications of such libraries' behaviour usually takes the form of human-readable documentation.
We write ...
1
vote
0
answers
60
views
Optimal package structure - Command Line Interface
I have an ongoing project where the directory structure currently is a mess (github Directory) and I would like to strucure it to eventully create a python package out of it. Below I have outlined a ...
-3
votes
1
answer
233
views
Proper way to organize Small Functions in PHP
I have a bunch of small utility PHP functions that I made to solve different scripting problems. Functions like UUID() and trackUserActivity() etc. There are tons of these functions and increasing ...
9
votes
4
answers
7k
views
Domain Driven Design - Updating and persisting aggregates
I'm trying to wrap my head around the best possible solution in the following situation:
When updating part of an aggregate, could be any part of the aggregate so either the root or any other entity, ...
14
votes
5
answers
5k
views
What kind of logic can Domain Objects realistically contain?
I have been struggling with this concept in the context of web applications ever since I first read about it. The theory states that the domain objects should encapsulate their behaviour and business ...
0
votes
1
answer
644
views
where to call repository update/add methods?
I have a domain service and i need to create an aggregate inside it, because the logic for create this aggregate involves another aggregates and calls to repository to check some business rules.
Is ...
1
vote
1
answer
665
views
Clean Architecture: are repositories always needed?
I'm trying to apply Clean Architecture to a mobile Android App, but I still have some doubts about how to manage API calls.
Currently, the classes are structured like this:
View -> ViewModel -> ...
2
votes
0
answers
320
views
Changing entities in Clean Architecture
I'm modeling the "Domain" Layer of "Clean Architecture" for an application that gets its data from an XML file when starts.
The XML file looks like:
<?xml version="1.0" encoding="UTF-8" ?>
<...