zipkin-php icon indicating copy to clipboard operation
zipkin-php copied to clipboard

Map is already too complicated

Open jcchavezs opened this issue 5 years ago • 2 comments

Initially Map was a Getter/Setter supposed to act as a usual map (i.e. set/get by key, see https://github.com/openzipkin/zipkin-php/blob/master/src/Zipkin/Propagation/Map.php), unfortunately I also promoted its use for HTTP headers (for things like Symfony) and that is how Map also supported case insensitiviness and array access.

Nowadays the lesson learnt is that each different Getter/Setter format deserve its own implementation rather than trying to reuse Map and hence to not add crap into existing abstractions. We can't change Map to be simpler now but we can create a very simple class for a truly simple map and use for the messaging abstraction (and deprecate Map), not sure how to call it tho:

  • SimpleMap
  • Array
  • ?

Any idea @adriancole @anuraaga

jcchavezs avatar Sep 07 '20 09:09 jcchavezs

Some other ideas

PropagationMap (we are creating the Map used for propagation FWIU) StringMap StringArray (no clue if Map or Array is clearer in PHP)

anuraaga avatar Sep 09 '20 05:09 anuraaga

I would not combine the two honestly, unless it is usual to do that. just make a subtype of getter/setter which gets the point across?

codefromthecrypt avatar Sep 09 '20 06:09 codefromthecrypt