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

Some ideas #62

Closed
dimzon opened this issue Apr 4, 2014 · 5 comments
Closed

Some ideas #62

dimzon opened this issue Apr 4, 2014 · 5 comments
Milestone

Comments

@dimzon
Copy link
Contributor

dimzon commented Apr 4, 2014

sorry for my poor english

I propose you to use ReflectASM or something like it for faster object creation and property assignment

  1. convert FieldSetter to interface and use factory to obtain it
  2. use ServiceLoader api to obtain FieldSetter factory failing back to yor current reflection-based implementation
  3. allow to pass FieldSetter factory to sql2o objects (to override sql2o default behavior)
    this will allow to write third-party FieldSetters optimal for some JVM implementations

QuirksMode - this is really ugly (not Java-way) solution. Better way is to declare iterface Quirks and move all quirks-related code into interface methods. QuirksMode must implement this interface. This will allow to create third-party Quirks implementation for other databases|drivers

API - need easy API to invoke sql2o ResultSet->POJO code for someone who can't use sql2o "from the scratch" (sometimes you need to write code obtaining jdbc Connection or Statement or ResultSet from caller and you can't change caller code).

@dimzon
Copy link
Contributor Author

dimzon commented Apr 4, 2014

Columns to Field mapping
the best way to make it versatile is GoF Strategy Pattern allowing any third-party tweaks via custom ColumnMappingStrategy implementation.

@aaberg
Copy link
Owner

aaberg commented Apr 5, 2014

Hi Dimzon,

Thank you very much for your suggestions.

I will definitely take a look at ReflectASM. Maybe do a test to see how much performance will improve. As you suggest, I also think it is important to be able to fall back to using java reflection.

I also agree that the QuirksMode solution is far from perfect. This is definitely open for improvements. I really like your suggestion; might be worth checking out.

Your other suggestions are good too, will consider them as well.

Thx!

Regards
Lars Aaberg

@aaberg aaberg added the feature label Apr 5, 2014
@aldenquimby aldenquimby added this to the 2.0 milestone Apr 7, 2014
@aaberg aaberg modified the milestones: 1.4.1, 2.0, 1.5.0 Apr 7, 2014
@aaberg
Copy link
Owner

aaberg commented Apr 8, 2014

I think it's closing time for this issue.
@dimzon leave a comment if you think we didn't cover everything.

@aaberg aaberg closed this as completed Apr 8, 2014
@dimzon
Copy link
Contributor Author

dimzon commented Apr 8, 2014

Some refactorings must be done in compatibility-breaking version
So auto-camel-case case-sensetivity custom-property-mapping must be re-implemented via GoF:Strategy pattern - ColumnMappingStrategy interface wich must obtain set of Pojo properies, set of ResultSet columns and return column->property binding pairs

@aaberg
Copy link
Owner

aaberg commented Apr 9, 2014

I agree. That is described in issue #83 .

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

No branches or pull requests

3 participants