3

In most examples I see, they tend to have one GitHub/cvs repository per bounded context, this does seem to be the best thing to do.

My question pertains specifically to user interfaces do they live in a separate repository which holds just ui's or is each interface included within the repository of the bc itself ?

What about interfaces which compose data from multiple bc's ?

Just to make it explicit here I am trying to gather how to physically organise code in a ddd project

Sudarshan
  • 8,574
  • 11
  • 52
  • 74

1 Answers1

2

Considering a tag would apply to the full Git repo, it is best to have two sets of files (like an UI and a BC) in two separate repos if:

  • you can make evolutions (and apply new tags) to one without touching the other
  • the number of files involved is important enough (if the UI is just one or two file, that might not be worth the trouble to create a dedicate repo for it)

As the OP Sudarshan summarizes below in the comments:

If a UI was dedicated to a BC, then it could live within the same repo as the BC itself or a separate one, depending on whether it will evolves on it own or not.

However for UI's that span across BC's it is better to spawn them in a repo of their own and use submodules to reference the right BC repo's

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So would you have something like a orderingBC and orderingBCUI if the UI was a non trivial one ?, and what are your thoughts for user interfaces which span across Bounded contexts ? – Sudarshan Oct 03 '14 at 09:06
  • @Sudarshan as long as they can evolve on their own, they can be in their own repo, and referenced by the BC repos as submodule (http://stackoverflow.com/a/23004273/6309). – VonC Oct 03 '14 at 09:09
  • thanks for "they can evolve on their own" makes things clearer, also I wanted to pick your brains on how you would deal with user interfaces that span across multiple BC's ? – Sudarshan Oct 03 '14 at 09:11
  • @Sudarshan "interface" as in "UI" or as in "API"? – VonC Oct 03 '14 at 09:13
  • @Sudarshan If a UI spans accross BCs, it means it is using services from multiple BCs. That would change the fact that this UI would be in its own repo, and uses several submodules for referencing the right BCs repos. – VonC Oct 03 '14 at 09:16
  • So can we say something like if a UI was dedicated to a BC, then it could live within the same repo as the BC itself or a separate one, depending on whether it will evolve on it own or not. However for UI's that span across BC's it is better to spawn them in a repo of their own and use submodules to reference the right BC repo's – Sudarshan Oct 03 '14 at 09:22
  • @Sudarshan that is the idea, indeed. I have included your last comment in the answer for more visibility. – VonC Oct 03 '14 at 09:23