You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Most configuration in Zircon is done through the AppConfig object (and its buddy, AppConfigBuilder). However, all the configuration here is generic -- applicable to all (or most) Zircon programs.
However, there's some configuration that's going to be specific to a particular extension, platform, or implementation, and it'd be convenient for that to still be managed via the central AppConfig object. So, we need some kind of API that's exposed to plugin authors and, inevitably, minimally exposed to end-users.
AppConfigKey<T> would be a simple interface that looks like this:
interfaceAppConfigKey<T>
In both cases, properties are represented internally in a simple map.
Usage
These APIs would primarily be used by plugin authors and non-core code. For example, to support custom tileset loaders (which are specific to a particular rendering module), the zircon.jvm.swing module could contain these extension functions:
As you can see, the end user is easily able to set the custom tileset loaders and (if desired) the ability to retrieve them is limited to the library author.
Describe alternatives you've considered
Make AppConfig open and provide subclasses with the necessary methods. However, this means the end user can only pick a single specific subclass, making supporting multiple extensions impossible.
We could create additional AppConfig-like objects that get passed into the main Zircon constructors, but this seems needlessly complicated.
End users would have little use for this API, so we should dissuade them from using it.
Additional context
This is a blocker for custom tileset loaders.
The text was updated successfully, but these errors were encountered:
nanodeath
added a commit
to nanodeath/zircon
that referenced
this issue
Apr 27, 2021
adam-arold
added
enhancement
Enhances existing functionality without introducing new features
feature
New functionality for the program
and removed
enhancement
Enhances existing functionality without introducing new features
labels
Apr 29, 2021
Is your feature request related to a problem? Please describe.
Most configuration in Zircon is done through the
AppConfig
object (and its buddy,AppConfigBuilder
). However, all the configuration here is generic -- applicable to all (or most) Zircon programs.However, there's some configuration that's going to be specific to a particular extension, platform, or implementation, and it'd be convenient for that to still be managed via the central AppConfig object. So, we need some kind of API that's exposed to plugin authors and, inevitably, minimally exposed to end-users.
Describe the solution you'd like
I'm proposing the following new APIs:
AppConfigBuilder
AppConfig
AppConfigKey<T>
would be a simple interface that looks like this:In both cases, properties are represented internally in a simple map.
Usage
These APIs would primarily be used by plugin authors and non-core code. For example, to support custom tileset loaders (which are specific to a particular rendering module), the
zircon.jvm.swing
module could contain these extension functions:As you can see, the end user is easily able to set the custom tileset loaders and (if desired) the ability to retrieve them is limited to the library author.
Describe alternatives you've considered
open
and provide subclasses with the necessary methods. However, this means the end user can only pick a single specific subclass, making supporting multiple extensions impossible.End users would have little use for this API, so we should dissuade them from using it.
Additional context
This is a blocker for custom tileset loaders.
The text was updated successfully, but these errors were encountered: