I am aware that Autoloads are not solely supposed to created a global Storage, and that they provide a lot of versatility to create permanent systems at runtime outside of that, but that is kinda my point.
–
I just wondered why even use Autoloads to store data and manage signals, and Resources can do so just the same, why not use those instead. I guess there is literally just no point at all in doing that, unless you really want stuff to be globally accessible, but even then it might be better to just have a Autoload which is a Container for those dependent Resources.
Whenever I see people talk about EventBuses, its usually just a full Autoload made to get everything interconnected, which I don’t like, as it risks a lot of cross-reference spaghetti across systems.
I used to split them into smaller buses, which would then be a seperate Autoload, or class within a Autoload, per-system, but even then, why would I have that at all when each system could just have its own Bus.
Now I’m using a Resource per-system, and while it also might lead to overdependency once I try to couple multiple systems together, it currently just provides a proper source of information, such as Data to reference or Signals to listen to, for each individual system, where any component can just connect itself to the Resource, and pass on its “message” to it, and anything else within the system can just as easily connect to it, without every having to risk nulls with dependency, as the Resource itself is just the “Bus”.
Ultimately it will probably go towards the same problems as a simple Autoload, but at least it works WITHOUT having to autoload, making reusability way cleaner imo
I guess instead of adding dependency I could then write some sort of translator/adapter between the Resources, which would then be project-specific, so I don’t bloat dependencies.
Maybe I’ll move away from EventBuses at some point, but currently I just love them way too much… especially for UI, where they are my main use case, as I still struggle with coupling UI properly, and having a way to just listen in without needing to couple is nice…