So, I have a solution that contains several large projects that I am trying to break down into smaller projects with more isolated responsibilities. This is a game, but I'm mostly a LOB developer, and I think the principles are probably universal, and I think I could learn something here.
Dependencies in some objects are too closely intertwined, and I hope for some help on how to unravel them. Or maybe some kind of pattern or abstraction that can make them more manageable.
Ares.Core.World has classes in itself, such as Creatures, Items, etc. They all inherit from Entity, which knows which cell on the map it exists. This is achieved by referencing Ares.Core.UI.MapControls.MapCell ... And you can see that the wires are already crossing.
Ares.Core.UI.MapControls contains Map and MapCell, each of which contains lists of creatures and the elements that they contain. MapCell also inherits from Ares.Core.World.Entity, since it allowed us to solve several early problems very elegantly - for example, all objects have an inventory.
I would like to find a way to separate UI and World into separate projects ( Ares.World and Ares.UI ), as the user interface and the comprehensive world should probably be separate issues. But, as you can see, as of now, the two projects had to link to each other, and circular links were not allowed.
I am wondering if there are any architectural patterns that can help in this situation. Thanks!
source share