navibyte / geospatial

Geospatial data structures, tools and utilities for Dart and Flutter.
https://geospatial.navibyte.dev
Other
54 stars 5 forks source link

Rename writers and content interfaces to generalize #127

Closed navispatial closed 2 years ago

navispatial commented 2 years ago

BaseWriter is specified as:

/// An interface to write objects into some content format.
// ignore: one_member_abstracts
abstract class BaseWriter {
  /// A string representation of content already written to this (text) writer.
  ///
  /// Must return a valid string representation when this writer is writing to
  /// a text output. If an output does not support a string representation then
  /// returned representation is undefined.
  @override
  String toString();
}

There is also an issue #126 as an proposition to change it.

Actual writers, PropertyWriter, CoordinateWriter, GeometryWriter and FeatureWriter are mixins that implement BaseWriter.

However mixin writers define content stream method and the base writer output data access. So different purposes.

Some refactoring and remodeling is needed:

class ContentWriter<T> extends BaseWriter {
}

Now when actual content writer are needed they are referenced as ContentWriter<PropertyContent>, ContentWriter<CoordinateContent>, ContentWriter<GeometryContent> and ContentWriter<FeatureContent>.

This shall be breaking change but maybe worth it...

navispatial commented 2 years ago

Implemented in geobase 0.3.0-dev.1.

Quite large changes. Please see code. Related to #129.