Skip to content
This repository was archived by the owner on Jun 22, 2023. It is now read-only.
This repository was archived by the owner on Jun 22, 2023. It is now read-only.

Remove GeometryServiceProvider.Instance #53

@airbreather

Description

@airbreather

This is somewhat related to #30, but that issue is very broad, so I wanted to give this its own arena for discussion.

GeometryServiceProvider.Instance isn't actually used anywhere in GeoAPI itself. Its sole purpose seems to be a common point of reference for downstream consumers.

This sounds neat, but it creates some problems:

  1. Downstream consumers need to set it themselves somehow, either by explicitly calling this sometime after being loaded (see Automatically set GeometryServiceProvider.Instance when NTS is loaded. NetTopologySuite#236) or by passing this responsibility to their own consumers.
    • This creates its own friction, since it's not clear to ORM providers whether or not they should be setting this themselves.
  2. GeoAPI implementers shouldn't rely too much on this, even if they set it themselves, because some other GeoAPI implementer might set it later.
  3. Related challenges that have been overcome in the past year or two (from when this issue was opened).

In the face of all those problems, the practical benefits are questionable. I may have to eat my words on this, but in its current state, I find it difficult to imagine a particularly useful project that depends on GeoAPI.Core without also depending on something more concrete, such as NetTopologySuite.Core. So if there is, in fact, a need for a global default instance, then it could just as easily be NtsGeometryServices.Instance or something similar.

In a post-#30 world, there may be a use for having GeoAPI export a global variable that can be used as a default to reduce the friction of the API, depending on how the architecture looks in the end, but right now I feel that it doesn't add enough value on top of NtsGeometryServices.Instance to be worth keeping around (for reasons other than backwards-compatibility).

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeDoing this would break either source or binary compatibility with existing versions.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions