Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Contact:

full name

Tracker:

http://jira.codehaus.org/browse/GEOT-2376

Tagline:

Excerpt

modifyFeatures(Name,Value,Filter)

This page represents the current plan; for discussion please check the tracker link above.

Section
Column
width60%
Table of Contents
Column
Children Display

Description

I have a bug assigned to me, GEOT-2376 covering what appears to be a mistake early on when defining FeatureStore. The modifyFeature methods both take an AttributeDescriptor, rather then a Name.

There are a couple of drawbacks to this:

  • it introduced the possibility of error (the user has to look up the exactly correct attribute descriptor).
  • It "mixing up "query" api with "metadata" description (a mistake me made earlier when Filter required an AttributeType)
  • it is needlessly complicated

To back up this bug a code review of all feature store implementations show that:

  • implementors noticed the waste of time and simply use the provided AttributeDescriptor as as String (using descriptor.getLocalName())
  • i the case of JDBCDataStore they look up the correct attribute descriptor by Name and silently substitute.

API CHANGE

Before:

Code Block
interface implements FeatureStore<T,F> extends FeatureSource<T,F> {
   ...
   modifyFeature( AttributeDescriptor type, Object value, Filter filter );
   modifyFeature( AttributeDescriptor type[], Object value[], Filter filter );
   ...
}

After:

Code Block
interface implements FeatureStore<T,F> extends FeatureSource<T,F> {
   ...
   modifyFeature( Name name, Object value, Filter filter );

   @deprecated
   modifyFeature( AttributeDescriptor type, Object value, Filter filter );

   modifyFeature( Name names[], Object values[], Filter filter );

   @deprecated
   modifyFeature( AttributeDescriptor type[], Object value[], Filter filter );
   ...
}

The patch also updates implementations and passes tests when applied against 2.6.x at the time of writing.

Related:

  • It would be kind to add SimpleFeatureStore implementations that take a String should that proposal be accepted.

Status

This bug report now needs a proposal as it reflects an api change; the patch is ready.

Proposal accepted; applied to trunk:

Tasks

 

no progress

(tick)

done

(error)

impeded

(warning)

lack mandate/funds/time

(question)

volunteer needed

  1. Apply patch from http://jira.codehaus.org/browse/GEOT-2376 to trunk
    • May wish to update SimpleFeatureStore with modifyFeature( String name, Object value, Filter filter ) and modifyFeatures( String name[], Object value[], Filter filter )
  1. Update example code