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

Allow user customized MappingStrategies #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oillio
Copy link

@oillio oillio commented Sep 22, 2016

I ran into a situation where I needed to write my own MappingStrategy. I was able to implement this in the current release, but it is not very clean. It required extending DefaultMapperFactory and MapperFacadeImpl. It would be nice if I could define and inject my own MappingStrategy without so much trouble.

I wrote up a quick implementation of my line of thinking. Each MappingStrategy type has a factory, which knows if its strategy can be applied to the requested mapping, and it can create the strategy for the mapping.
When a strategy is required, the system will query each registered factory (user defined first, then default factories). The first factory that can take the job will produce the strategy.

If this looks like a feature you would be interested in adding, and this implementation is acceptable, I can clean it up, add documentation and testing.

@ndr-brt
Copy link
Collaborator

ndr-brt commented Dec 9, 2016

Hi, can you resolve conflicts and try to merge again? thanks ;)

@oillio
Copy link
Author

oillio commented Dec 15, 2016

Done

@brabenetz
Copy link

The commit @5e796ce only contains the interface MappingStrategyFactory.java
I would have expected also some implementations where it is used.
Is there something missing?

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

Successfully merging this pull request may close these issues.

None yet

3 participants