Binoy Shah
09/08/2022, 9:16 PMsandy
09/08/2022, 9:23 PMBinoy Shah
09/08/2022, 9:27 PMSo, why use resources?
Plug in different implementations in different environments - If you have a heavy external dependency that you want to use in production, but avoid using in testing, you can accomplish this by providing different resources in each environment. Check out Separating Business Logic from Environments for more info about this capability.
Share configuration across multiple ops or assets - Resources are configurable and shared, so you can supply configuration in one place instead of configuring the ops and assets individually.
Share implementations across multiple ops or assets - When multiple ops access the same external services, resources provide a standard way to structure your code to share the implementations.
I might be leaning on to this portion ☝️ . It does not explicitly say it but I am not clear enough as to why a construct like Resources
was created.
Utilizing resources would allow a user to share it without direct reference injection, but why even have it, external service can be used by multiple callers just by creating a singleton object and passing its reference@resource
or @op
or just a direct call to subprocess
Mike Atlas
09/08/2022, 9:40 PM