-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use protected
so EntityGenerator can be extended
#466
Conversation
This is definitely something I'd like to be able to extend, and I imagine others might too.
Hello, thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link: |
Wouldn't it be better to create an interface and make the EntityGenerator implement it? |
I don't think so. I mean, we could have an interface too, but the issue isn't so much that all EntityGenerator's needs to present the same methods to some other cooperating class. The problem is that if I want to make tweaks to how generation works, I have to reimplement (read: copy and paste) the existing functionality into a new class and then make my tweaks there, rather than just subclassing the existing class. |
@beberlei it may be time to complete your CodeGenerator project and migrate the EntityGenerator to it :) |
Some of the private (protected) methods (especially the ones that are complicated, like generateAssociationMappingPropertyDocBlock) could be moved into separate components and the EntityGenerator could be parametrized by injecting those components (composition over inheritance principle). It's a big refactoring work to be done but it might be worth it. Anyway in a short term your approach is fine. |
@ethanresnick the goal is to rewrite the EntityGenerator entirely based on it. |
Use `protected` so EntityGenerator can be extended
I will merge this as I have no defined roadmap when i will finish the code generator replacement. |
Sounds good. Thanks! |
This is definitely something I'd like to be able to extend, and I imagine others might too.