In compose api guidelines, what does ```App develo...
# compose
a
In compose api guidelines, what does
Copy code
App development SHOULD prefer simpler concrete types until the abstraction provided by an interface proves necessary. When it does, adding a factory function for a default implementation as outlined above is a source-compatible change that does not require refactoring of usage sites.
mean exactly? Should we not hoist our state with an interface and an implementation like so?
This is in the context of writing an app and not a library.
a
your link "so" looks broken so I'm not sure I'm answering the question, but basically the point of the paragraph is that even if you don't start with an interface, in Kotlin you can still swap in an interface later without breaking anything. so there is no need to add an interface if the only reason is "future-proofing"
👍 3
a
Ahh that makes sense, thank you!