I entered yesterday to my new job and while browsing their repositories, I noticed they have a project for every resource of a REST API. For example, if they need to add a REST resource called "people", they proceed to create a whole new repository that contains only the endpoints of the resource "people".

Honestly I've never seen something like this before and I can only see downsides of this design, for example for every piece of reusable code, they just copy and paste it multiple times across the projects that are part of the REST API and sometimes they make a library and share it across the repositories. Even with the library approach I think this will be a mess to deal with. Am I wrong? Does this design provides any advantages?

Currently there is only one maintainer and he is on vacations so I need to wait for the next week to ask him about this decision.

closed as unclear what you're asking by gnat, Greg Burghardt, BobDalgleish, Bart van Ingen Schenau, jwenting Jul 5 at 4:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • how did maintainers of this code explained their reasoning when you asked them about it? You have asked them prior to posting here, haven't you? – gnat Jul 3 at 12:38
  • @gnat Currently there is only one maintainer and he is on vacations so I need to wait for the next week to ask him about it. – Chromz Jul 3 at 12:40
  • Perhaps, each project belongs to a different customer (business unit). Usually, there's the main project that evolves as the company need and then "forks" or customizations for VIP customers. I have seen this a couple of times. Every time one customer pays for a new feature it also pays for its exclusivity. If they don't, other projects (hence, the competence) might adopt the feature "for free" if the company deem it appropriate for the business:-) – Laiv Jul 3 at 13:20
  • @Laiv There's one VIP costumer that asked for their own customization (but didn't confirm it) so I think you are right about this factor taking a role in the decision. – Chromz Jul 3 at 13:33
  • Seems like it'd have been a lot easier and more maintainable to separate features and code for those different customers using branches in your version control system rather than separate repositories. – Lie Ryan Jul 4 at 3:03

Generally more projects == good. But only because the standard 'bad' approach is a single massive project with everything in.

Separation enables the compiler to enforce dependency boundaries and forces you to think.

So in your example, by putting each resource in its own project you stop those projects depending on each other. Isolating their sections of code into libraries, enabling you to test them separately and helping with your change control.

However, there is a bit of a change with .net standard, in that the compiler will try to make each project a nuget package. If you want to distribute multiple projects as a library in a single package you will have to do some fiddling around.

This again forces you to think about your dependencies and how you are going to seperate them. Will calling code always use this set of classes together or will some code only need set x and some only set y?

The next step after separating things into project is to separate them into their own source control and use binary references. You know for sure that you haven't broken something when you are using the exact same same dll as before

  • Is "too much separation" also a problem? If yes does this case apply for it? – Chromz Jul 5 at 15:17
  • not realy. I mean what are we talking about, extra work setting up CI, a couple of extra builds instead of having everything built together, an extra vs window open? A small price to pay compared to painting yourself into a corner – Ewan Jul 5 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.