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
Currently, the 'truth' of what table or column names will be used, by a connector, is defined by the model.
This is an issue, because:
The model is intended to only be a container of data and nothing more. It should not have any knowledge of the underlying data source.
The database settings are configured in the model's static class definition, so only one set of configuration is supported at runtime. This means that the model can only be effectively used for one active schema+table on the same connector type.
The database connector settings cannot be easily configured at runtime, such as from a config file. Since the settings are stored in the prototype, injection via @config/@Inject cannot be used. This leads to hardcoding the knowledge of the database layout into the source file itself, which makes distribution/reuse more difficult, as changes will require editing sources and compiling.
Knowledge of where and how the data is stored should be the responsibility of the data source, not the model. Or even the repository, in my opinion.
The DataSource class should accept settings that allow a mapping for models, which is then read by the Connector class first, only falling back to the model definition if not specified.
At this point, Connector.getConnectorSpecificSettings should check if the mapping exists in the DataSource first, then fall back to the model second, for compatibility purposes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, the 'truth' of what table or column names will be used, by a connector, is defined by the model.
This is an issue, because:
Knowledge of where and how the data is stored should be the responsibility of the data source, not the model. Or even the repository, in my opinion.
The DataSource class should accept settings that allow a mapping for models, which is then read by the Connector class first, only falling back to the model definition if not specified.
A quick pseudo config example:
At this point,
Connector.getConnectorSpecificSettings
should check if the mapping exists in the DataSource first, then fall back to the model second, for compatibility purposes.Beta Was this translation helpful? Give feedback.
All reactions