-
Notifications
You must be signed in to change notification settings - Fork 208
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
Implement bundlers to support custom serializers #71
Conversation
Wow, thanks @ultimate-deej I appreciate you taking the time for writing this. Your approach looks generally good, here's a few pointers from my point of view:
{{bundlers}}
private static final {{class}} {{name}} = new {{class}} ();
{{/bundlers}} That should make it much more performant (and simpler to test). No need to look dynamically for them, we can generate them at compile time. |
Ok, will add some tests/samples. |
Unless it makes the code easier to write and to read, I wouldn't bother with generating a Master class. Are there any other benefits a part from less memory consumption? |
Creating an instance for every call is obviously wrong. Instead, we want a single instance for the whole lifetime of an app. |
My approach is to make it work the simplest solution first and then iterate on that. For this PR a static instance per helper is enough. |
Going to try it anyway, I don't think it will be much harder. |
I've changed it to store instances in a single file. Also I want to clarify something regarding tests. Do they merely check the contents of generated files? |
I can't think of a clean way to make it work with libraries. Generating a random suffix would make the test harder to write and needlessly complicate the implementation. My advice is (at the cost of sounding like a broken record) make it work with static members first. I'm not fully understanding your question about the tests. The |
I'm not sure if I understand. In the latest revision bundlers are stored as static final fields in |
API looks good. 👍 In terms of the bundler variables, what about just creating them new for each |
Personally, I'm comfortable with a hash map. Calls to Icepick are pretty rare, and they are not very performance-sensitive (at all if you ask me). So I'd revert to the initial implementation, as it will allow to use it in libraries, while not affecting performance much. |
The |
@johncarl81 It is a bundler class to bundler instance map |
I dare to say I am not the only one waiting this PR merged so finally I could have both Parceler and IcePick in the projects. Hope current stagnation is just temporary. Thanks for all the efforts guys. |
Implement bundlers to support custom serializers
This PR is not finished but I'm going to pick it up from here |
Pushed |
Thank you |
We discussed the issue lately in #20, and I decided to try to actually implement this.
Some comments on the implementation:
Also I'm very new to both Clojure and annotation processing, so I won't be surprised if you say everything is terribly wrong or something like that. However I'd appreciate any advice on how to improve it, especially considering the fact you are obviously more experienced in these.