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
2answers
47 views

DDD How to populate AggregateRoot from Repository when properties and collections should be readonly

If the entity should be always in valid state (therefore the properties are readonly and can be set only by methods which contains validation), How can I build this entity inside Repository without ...
0
votes
1answer
71 views

MVC Controller calling UoW (unit of work) directly instead of going through Service Layer

Currently im injecting my Unit of Work inside the controller. I figured out that in most of the designs, controllers calls the service layer and service calls the repository/DAL layer. Most of the ...
0
votes
1answer
107 views

DDD: Aggregate with nested childs

I have a CategoryClass (Aggregate root) -> SubCategoryClass -> and now a relational entity (n-n). Category (root) 1->N SubCategory 1->N SubCategorySlotType (n-n) SlotType (root) My SubCategory only ...
0
votes
2answers
99 views

Updating the db in the repository from a DTO in a layered architecture

Given a Person model: Person { int PersonId; string Name; string Email; } and an UpdatePersonDto which just updates the Name UpdatePersonDto { int PersonId; string Name; } How ...
0
votes
1answer
102 views

Does a 'leaky' repository implementation defeat the point of a repository?

I've seen some tutorials and examples of implementing a repository pattern, and I don't quite understand something. My impression was that the whole point of a repository pattern was to hide the ...
1
vote
1answer
89 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
189 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 ...
0
votes
0answers
26 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
121 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
535 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
122 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
126 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 ...
2
votes
1answer
198 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 ...
-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
84 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
199 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 ...
3
votes
1answer
107 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 ...
1
vote
0answers
66 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 ...
4
votes
1answer
158 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 - ...
2
votes
2answers
155 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 ...
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 ...
1
vote
0answers
58 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 ...
8
votes
3answers
1k 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
votes
1answer
42 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 ...
1
vote
1answer
1k 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
699 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 ...
1
vote
1answer
72 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 ...
0
votes
1answer
120 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 ...
4
votes
1answer
546 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
175 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
273 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
415 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 ...
1
vote
2answers
97 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 ...
4
votes
3answers
1k 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 ...
5
votes
2answers
522 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, ...
-3
votes
2answers
254 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
79 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 ...
4
votes
1answer
60 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
118 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 ...
3
votes
2answers
279 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
248 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
273 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 ...
1
vote
0answers
306 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
544 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 ...
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 whole picture (The details ...
3
votes
1answer
882 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 ...
2
votes
2answers
675 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 ...
7
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
260 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 ...