Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map is already too complicated #178

Open
jcchavezs opened this issue Sep 7, 2020 · 2 comments
Open

Map is already too complicated #178

jcchavezs opened this issue Sep 7, 2020 · 2 comments

Comments

@jcchavezs
Copy link
Contributor

jcchavezs commented Sep 7, 2020

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

@anuraaga
Copy link

anuraaga commented Sep 9, 2020

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)

@codefromthecrypt
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants