Remove bidirectional dependency between hostnameResource and configService #24

Merged
antman merged 2 commits from fix-bidirectional-hostnameResource-config into main 2026-09-04 06:19:21 +00:00
Owner

Motivation

It is a architecture smell when component X depends on component Y yet simultaneously component Y depends on component X. In this case, the config manager needed access to the hostname resource to tell it when to update the hostname values, but the hostname resource also had access to the config manager to tell it when the hostname changed unexpectedly.

These bidirectional dependencies tend to cause problems later on, especially as a system grows more complex.

Solution

Having the hostname resource emit events for other components to subscribe to allows the config manager to fully own/manage the relationship between itself and the hostname resource.

This is also a step in the right architectural direction for having the config manager turned into more of a DiffEngine that manages divergence of target and actual state, allowing the system to be self healing

### Motivation It is a architecture smell when component X depends on component Y yet simultaneously component Y depends on component X. In this case, the config manager needed access to the hostname resource to tell it when to update the hostname values, but the hostname resource also had access to the config manager to tell it when the hostname changed unexpectedly. These bidirectional dependencies tend to cause problems later on, especially as a system grows more complex. ### Solution Having the hostname resource emit events for other components to subscribe to allows the config manager to fully own/manage the relationship between itself and the hostname resource. This is also a step in the right architectural direction for having the config manager turned into more of a DiffEngine that manages divergence of target and actual state, allowing the system to be self healing
emit events from hostname resource
Some checks failed
/ test-and-lint (push) Failing after 1m31s
2c33c70717
derp
All checks were successful
/ test-and-lint (push) Successful in 3m9s
995ffd3375
antman merged commit fc0ee6d5f1 into main 2026-09-04 06:19:21 +00:00
antman deleted branch fix-bidirectional-hostnameResource-config 2026-09-04 06:19:21 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/server-manager!24
No description provided.