-
Notifications
You must be signed in to change notification settings - Fork 864
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
Convert Attributes and AttributeValue into interfaces #1589
Conversation
…ory classes to create them.
Codecov Report
@@ Coverage Diff @@
## master #1589 +/- ##
============================================
- Coverage 91.67% 91.55% -0.13%
- Complexity 979 1006 +27
============================================
Files 116 126 +10
Lines 3533 3530 -3
Branches 307 298 -9
============================================
- Hits 3239 3232 -7
- Misses 203 205 +2
- Partials 91 93 +2
Continue to review full report at Codecov.
|
Can you link the corresponding issue or otherwise state a rationale? |
Sorry about that. I probably should have marked this as a draft. This is another attempt, in a long series, at providing a way for the java agent to not have to do a bunch of bending-over-backwards to do extra wrapping of concrete classes that exist in the API. I'll update the description with pointers to the many discussions. |
Ugh. I tried implementing both the unshaded and shaded AttributeValue interfaces at the same time, but |
@trask I think that is a downgrade in usability because cannot use switch statement. |
oh, bummer. Pretty stuck if we need to keep the Type around. If we got rid of AttributeValue altogether, and switched out for the typed keys, it might work, though. I don't remember if we still need the Type enum in that case. I'll take a look tomorrow. |
@jkwatson want to make sure we don't do all the decisions based on the ability to shade or not. It is very important the agent use-case but API should be developed for usability as well. That being said I am not oppose to search for new ways that are user friendly as well as agent friendly |
Absolutely. I always favor the user in these decisions (although our primary user is the instrumentation folks at the moment!). Trying to find the balance between developer ergonomics and performance in the agent is the name of the game. |
Closing this as a failed experiment, since it makes a less friendly API (with the inner Factory classes) and doesn't actually make it easier for shading in the agent. |
The creational methods are now in inner classes, which is definitely an API breaking change.
Note: had to pull out the other inner classes up a level, otherwise they would inherit the interfaces
public
access modifier.The rationale for this is to make life easier for the instrumentation agent code, where it is more desirable to deal with interfaces than abstract classes.
Relevant Issues:
AttributeValue
from the public interface. #1081Other PRs that strive to achieve the same goal in different ways: