Ticket #27 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

LayerRecord signature should look like Record signature

Reported by: tschaub Assigned to:
Priority: blocker Milestone:
Component: GeoExt.data Version:
Keywords: Cc:
State: Needs more work

Description

I think it would be useful for the LayerRecord constructor to look the same as the regular Record constructor (data, id). This would make it easier for a reader to be able to take either recordType.

Change History

03/24/09 01:17:27 changed by ahocevar

Not sure about this. Right now, the layer records and layers sync easily because layer.id equals record.id. Why would we want a specialized reader to create generic records? I'm open, however, to change the first argument to become an object ({layer: foo}), but this one would always need to have a layer property. Then we could get rid of the 2nd argument and just have

GeoExt.data.Record(/*Object*/ data)

The only thing I fear is that ids that the reader sets will be ignored then. But again, why would we want to create generic records with a specialized reader?

03/24/09 01:22:58 changed by ahocevar

Thinking about it a bit more: If the id thing is not important, then the signature could indeed be made the same as in Ext.Record. But in that case, syncing layers between map and store will be more expensive in the LayerStore. Which may not be a big problem. Patches welcome :-)

03/24/09 06:56:37 changed by elemoine

Guys, I created a ticket and a patch for that yesterday, see #25. With my patch the LayerRecord constructor has the same signature as the regular Record constructor, and creating layer records from layers is done with a LayerReader. The FeatureReader and LayerReader actually look very similar, I think we could factorize code a bit here, but this is the subject of another ticket.

03/24/09 09:17:27 changed by elemoine

  • status changed from new to closed.
  • resolution set to fixed.

(In [260]) add LayerReader, r=ahocevar (closes #25, #27)