mifriis / edge-of-kuiper

Textbased space rpg somewhat based on real science
Other
7 stars 3 forks source link

Create a consistent architecture #18

Open mifriis opened 3 years ago

mifriis commented 3 years ago

The code is a bit of a mess and i am starting to trip overmyself when adding new systems.

What is a good arch. principal to adhere to?

Is DDD the approach? image

mifriis commented 3 years ago

One consistent problem i have been facing is the seperation of concerns.

Our entities are very rich and have a lot of behaviour, see for example Ship and it's events. Ship needs to read and refference (but not write or change!) things like bodies of the solar system, it's captain, do a random roll (that can be mocked) etc. Currently this is handled through the SolarSystemLocator where you get a hook into the root aggregate (solarsystem -> Captain -> Ship).

Ship (and likely other entities) have events that also needs access to this stuff and bringing it all with you causes weird issues with circular refferences that requires us to bleed things like newtonsoft into our domain.

Having a good pattern for this would be gold.

Secondly, a definition of the pattern and what to name what. What is a Service? WHat about a repository? Are they locators or factories? Some documentation that we can link contributors to, so they know what to adhere towards,

mifriis commented 2 years ago

Trying to tackle this in #39