New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconsider the "FrameworkAdapter" infrastructure #11
Comments
Thanks for the feedback @facundobatista! I have tried to remove More specifically: charm-k8s-grafana/test/charm_test.py Lines 43 to 53 in 88006ba
|
I should also reference the comment that I added on an issue in the Operator Framework which is closely related to the question that I have above: canonical/operator#282 (comment) |
To be absolutely clear, I'm not using the above as a means to justify the existence of the |
Maybe @jameinel could help us here? |
So if you have to have the individual calls, you could always patch harness.charm.framework to be a mock which would intercept and record the individual calls. |
It's a layer above many things. A quite lightweight one, though, so there's not a lot of work hidden in that layer, but as it's a layer above several other things, to where each property belongs is not easily discoverable.
Most of the FrameworkAdapter attributes are from the Model, so they can always be accessed doing
self.framework.model
in the charm. But note that the charm already has shortcuts likeapp
orunit
(check the docs here).So, for example you're currently doing...
...and it's shorter and more accurate to do...
It's even absurd to have the separation layer when doing exactly the same thing, forcing you to write...
...when it's just doing exactly the same that you would be doing by...
This in general lowers a lot the learnability of this code. People getting here needs to learn this new abstraction layer instead of just using the Framework, as they are used to do.
An example of that is the developer needing to learn/understand what you're doing in...
...when it's simple (as long you know the Framework, which is a knowledge it's expected to have) to understand what the code does in...
It's fine IMO to have some layers/adapters as you have (for building the
build_juju_pod_spec
, for example).But in the case of the Framework, which is by design tightly coupled with the Charm (and the Model), I would totally recommend to not have this adapter.
The text was updated successfully, but these errors were encountered: