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

Redesign: 0. Freeform Notes

Joe Amenta edited this page Feb 14, 2019 · 1 revision
  1. @airbreather: I need to get my hands on the relevant ISO specs... they cost money, though.
  2. We should generally favor abstract classes over interfaces. Interfaces, especially without the default interface methods feature (which would be too late even if it was available today), are worse than abstract classes when it comes to extending them in a backwards-compatible way. Other advantages:
    • We can default-implement many spatial predicates (Covers, Intersects, etc.) in terms of a single abstract method that computes the DE-9IM relationship, just like what JTS (conceptually) does, without losing the ability for implementers to use pre-computed data (e.g., Envelopes, R-tree segment index) to optimize particularly important queries.
    • Non-virtual methods on the abstract class are superior to alternatives available to interfaces* when it comes to exposing "easier" ways to call a method with one or more "optional" parameters.
      • *alternatives include: adding the methods to the interface that all implementers must make sure to implement a particular way, extension methods that may be hard to discover, and using default parameters that have their own problems.
Clone this wiki locally