-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
Eliminate factory
modules
#2687
Comments
As noted in this comment, it may be preferable to expose this API as A related thought: this mechanism could also be used to provide a plugin interface for third-party widgets to provide platform-specific implementations. Consider the case of a third party widget that has native platform implementations - the widget could register as having providing a macOS implementation, then the interface use a standard |
The sub-module structure of each backend is identical, so that can already be considered a well-defined API between the interface and backend layers. Putting the "factory" namespace in between them adds complexity for no benefit, and also forces all the sub-modules to be imported whether the app uses them or not (#2547).
For example, where we currently write:
We could instead have:
Which on macOS would translate into an import of
toga_cocoa.hardware.camera
, and a getattr ofCamera
.For previous discussion, start at #2584 (review).
The text was updated successfully, but these errors were encountered: