The tag has no usage guidance.

learn more… | top users | synonyms

72
votes
10answers
8k views

Are (database) integration tests bad?

Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not ...
1
vote
2answers
166 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 ...
3
votes
1answer
63 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
2answers
108 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 ...
3
votes
2answers
940 views

Should I have separate units of work for each EF bounded context?

I have some EF bounded contexts like follows public class BoundedContext_1 : DbContext { IDbSet<A> As { get; set; } IDbSet<B> Bs { get; set; } } public class BoundedContext_2 : ...
2
votes
1answer
443 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 ...
0
votes
0answers
77 views

Repository Pattern: How to structure repositories with nested tables?

I'm working on an API and I always seem to run into this thought debate. When designing the code structure that interacts with the database (repositories, data providers ect..) how do I structure the ...
-4
votes
2answers
54 views

Cache repository violating the SRP [closed]

interface IRepository { Data getData(); } class BaseRepository implements IRepository { public Data getData() { ... } } class CacheRepository implements IRepository { private final ...
1
vote
1answer
69 views

Are repositories meant just for storing data?

One of the major benefits of the repository pattern is that you can easily switch out implementations for other implementations. After learning about this pattern I started to make tons of things ...
1
vote
1answer
172 views

Should I have code that only exists for testing?

I have a service class which is responsible for instantiating repositories and using them. It makes an external Http request which ideally I would like to mock for testing. However, I am not quite ...
5
votes
4answers
322 views

If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?

I've recently read a lot of arguments against using the repository pattern with powerful ORM's like Entity Framework as it incorporates repository-like functionality, along with Unit of Work ...
-2
votes
1answer
57 views

Repository UUID equivalent

I am converting an old Subversion repository to Git. Here is an example: $ svn info http://alfa.com/bravo/charlie Path: charlie URL: http://alfa.com/bravo/charlie Relative URL: ^/charlie Repository ...
4
votes
2answers
251 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 ...
2
votes
1answer
72 views

Structuring git repository as a 'catch-all'

I have a really old install of Debian on my Thinkpad, and I want to refresh it now that I'm using it again. However, I have a LOT of old scripts all over this install for beauty fixes, shortcuts, and ...
3
votes
1answer
29 views

How can I have multiple issue trackers with a shared repository?

I work on a large software project where many vendors contribute have forks of a shared repository. Everyone has their own internal repositories and issue trackers. The problem that I'm trying to ...
1
vote
1answer
56 views

Suggestions: Good format for short/commit messages for User Story and Sub tasks

I would like your opinion regarding a good style/format for short messages when committing into a repository (GIT or SVN). Considering we are using a feature branch development approach, with one ...
0
votes
0answers
61 views

What is a good directory structure for projects with versioned code but huge data files

We work with genomics and imaging data. Our data are large, but our code is small. We sometimes work on code collaboratively, and also wish to share it with the researchers we do analysis for. We are ...
2
votes
1answer
292 views

How to refactor services into API, repository and caching (.NET)?

I am working on a .NET project with, which started out as a prototype that now has to scale. We have the ASP.NET MVC stack with Entity Framework (code first). I would like to hear how to scale this ...
3
votes
2answers
3k 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 ...
2
votes
0answers
72 views

How to implement Repository that supports ORM's validation?

DDD has an abstract repository pattern to handle saving and fetching/finding entities in storage (db, external service, doesn't matter). My question is if Repository pattern has to only bring the ...
3
votes
3answers
179 views

Should you create a github repo/project for things as small as a useful function

Is it appropriate to make a fully blown github project/repo for something that you believe would be useful to others, but is as small as a single function?
0
votes
1answer
201 views

Neat way on passing interface parameter to a constructor

Having lots of Interface that needs to pass in a constructor looks messy, is there any neat way of doing it? Code snippet: public class Foo { private readonly IRepository1 _repository1; ...
3
votes
2answers
877 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 ...
3
votes
1answer
154 views

Understanding Generic Repository Pattern

I am trying to understand the generic repository implementation. I have seen this line (or similar to it) in many examples: public interface IRepository<TEntity> : IDisposable where TEntity : ...
1
vote
1answer
57 views

Repository Pattern Class Collection examples with Lazy/Eager loading

When implementing the repository it's fairly easy for a stand alone class. Unfortunately, we are unable to use an ORM to manage our data access, so I'm trying to recreate some of the functionality ...
2
votes
2answers
501 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 ...
3
votes
3answers
535 views

in DDD, should repositories expose an entity or domain objects?

As I understand it, in DDD, it is appropriate to use a repository pattern with an aggregate root. My question is, should I return the data as an entity or domain objects/DTO? Maybe some code will ...
1
vote
2answers
172 views

Should I use a single repo when multiple parts of the same project are running on the same server? [duplicate]

I'm planning a project that consists of the following parts: REST API in Lumen Web client in Laravel Product website in Jekyll These separate products are going to be running on the same server. ...
3
votes
5answers
356 views

Inheritance when following the Repository Pattern in PHP

I am trying to build a PHP application using the Repository Pattern but I'm not sure how I should implement the save method. I have an abstract class called ItemRepository which have the following ...
8
votes
2answers
105 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 ...
2
votes
2answers
356 views

Data Layer vs Business Layer

I think I'm in the minority on this but would be curious to see other perspectives. A lot of times I see people talk about the Data Layer like having functions like UpdateCustomer() or Summarize(). I ...
2
votes
2answers
66 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 ...
12
votes
2answers
458 views

Big project layout : adding new feature on multiple sub-projects

I want to know how to manage a big project with many components with version control management system. In my current project there are 4 major parts. Web Server Admin console Platform. The web ...
40
votes
9answers
14k views

Should Repositories return IQueryable?

I have been seeing a lot of projects that have repositories that return instances of IQueryable. This allows additional filters and sorting can be performed on the IQueryable by other code, which ...
6
votes
3answers
294 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 ...
2
votes
0answers
87 views

Justification for different code bases on different branches in the same repo? [closed]

Branches in git repos or similar are practically always derived from the same code base; after all, they're usually merged back in to master later. But, if you wanted your open source project on ...
6
votes
2answers
435 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&...
2
votes
3answers
69 views

Does Git subtree count as distribution for copyleft licenses?

If I include, say, a GPLv3 repository in in my repository using git subtree, would that count as distribution? Am I now required to license my repository as GPLv3 as well? I don't intend to modify ...
3
votes
1answer
100 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 ...
0
votes
5answers
448 views

To which layer does this code belong?

When I say "Revisional Data Model", I mean a data model where information is never lost: Deletes never destroy any rows, and updates always cause an insert somewhere else to preserve a row's previous ...
0
votes
0answers
49 views

Managing pagination or cursor with deleting items in the list

I have a REST API that could GET, POST, PUT, DELETE models. My problem is when I paginate that with ajax call combining with DELETE operations. My problem comes after few steps list one page list ...
7
votes
4answers
293 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 ...
1
vote
3answers
407 views

Repository matrix pattern?

I'm trying really hard to refactor some of my legacy code in the project using best practices and design patterns + DDD so I'd love some feedback on an issue I'm currently having. Let's assume that I ...
1
vote
1answer
146 views

How to handle a project in git with the same code but different templates?

I have a project where the only difference are the templates. The question is how should I manage this with git now? At the moment I have 3 different git Repos, but it's hard to maintain all 3 of ...
2
votes
1answer
69 views

Who should be responsible for syncing a repository?

Given an app, controller, model and repository (which holds representation of model), where should the sync service for the repository live? In my specific implementation, my app/controller are ...
2
votes
2answers
213 views

Handling insertion to database with Repository pattern

I have a design question for working with databases in object-oriented PHP. I have a table in my database called products. Then I have 2 classes for this table in my PHP project. ProductsRepository....
2
votes
2answers
122 views

Git Repository Setup

I am moving my companys source control from TFS to GIT. We have TFS currently defined as. Project Collection / / Client A / Product A / Product B / Product C / Client B / Product D / Product E / ...
3
votes
0answers
105 views

Proper GIT repository usage that accommodates feature branches and parallel testing

After reading around I found that there were various git workflows being used but there aren't enough (or I just haven't found them yet) info on how to use git properly with having test builds. I was ...
5
votes
1answer
2k 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 ...
3
votes
2answers
459 views

Should a domain object wrap/contain a DTO interface?

Using .NET - I have an interface IPerson. This interface is implemented by classes in multiple, separate repositories, e.g. EF6 (EfPerson), custom SQL (SqlPerson), or even custom assembly connecting ...