I just started a component based C# project where I got 4 main components:
- User (This is where the user is programming new features)
- Interaction ( Handles multiplatform input and drawable surface creation)
- Core computation ( computation + lot of wrappers for the next component)
- Native ( Handles multiplatform rendering + file system)
With this architecture I`m trying to decouple big pieces of code which have similar use cases.
Recently, I stumbled over a circular dependency issue of some componentents, because I tried to make only neighbor components communicating (e.g. 1 and 2, 3 and 4). That unsettled me, because I read about potentially bad design decisions, when circular dependencies are appearing.
Long story short: I now decided to use a hierarchical dependency, where all components can only communicate with all their children components recursively. So 1 can access 2, 3 and 4, but 4 cannot access 3, etc.
I decided to try this, because the 1. component requires to access configurations from the 4. component. Otherwise I would have to wrap the objects of each layer in the layer above.
What problems could arrive with such a hierarchival dependency structure?
Are there ways to organize it maybe better?
Aucun commentaire:
Enregistrer un commentaire