- Notifications
You must be signed in to change notification settings - Fork195
Refactor layer type registration usingLayerTypePresets to centralize and streamline configuration management.#457
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ze and streamline configuration management.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR refactors layer type registration by introducing aLayerTypePresets interface and ServiceLoader-based discovery mechanism to centralize and streamline configuration management. The hardcoded layer type registrations inSpatialDatabaseService are extracted into separate preset classes that can be discovered and loaded dynamically.
- Introduced
LayerTypePresetsinterface withRegisteredLayerTyperecord to define layer type configurations - Migrated layer type registrations from static initialization to ServiceLoader-based discovery
- Split layer type definitions into
SpatialLayerTypePresets(general types) andOsmSpatialLayerTypePresets(OSM-specific)
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
api/src/main/java/org/neo4j/spatial/api/layer/LayerTypePresets.java | Defines the newLayerTypePresets interface andRegisteredLayerType record for layer type configuration |
server-plugin/src/main/resources/META-INF/services/org.neo4j.spatial.api.layer.LayerTypePresets | ServiceLoader configuration file listing the preset implementations |
server-plugin/src/main/java/org/neo4j/gis/spatial/SpatialLayerTypePresets.java | Implementation providing general spatial layer type presets (SimplePoint, WKT, WKB, etc.) |
server-plugin/src/main/java/org/neo4j/gis/spatial/OsmSpatialLayerTypePresets.java | Implementation providing OSM-specific layer type preset |
server-plugin/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java | Refactored to use ServiceLoader for loading presets, removed hardcoded registrations and innerRegisteredLayerType class |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
server-plugin/src/main/java/org/neo4j/gis/spatial/SpatialDatabaseService.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
f69aca6 intomasterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Pull Request Overview
This PR refactors layer type registration by introducing a
LayerTypePresetsinterface and ServiceLoader-based discovery mechanism to centralize and streamline configuration management. The hardcoded layer type registrations inSpatialDatabaseServiceare extracted into separate preset classes that can be discovered and loaded dynamically.LayerTypePresetsinterface withRegisteredLayerTyperecord to define layer type configurationsSpatialLayerTypePresets(general types) andOsmSpatialLayerTypePresets(OSM-specific)