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

Introduce factory method for ProjectGenerator creation #1582

Conversation

zambrovski
Copy link
Contributor

@zambrovski zambrovski commented Nov 8, 2024

Current behaviour

Since the ProjectGenerator offers protected methods, a use case of sub-classing it is supported. In the same time, the ProjectGeneratorInvoker creates the instance of it just in place where it is used.

Expected behavior

I can easily subclass the ProjectGenerator and replace its invocation.

Proposed solution

This PR extracts the creation of the ProjectGenerator to a factory method. In doing so, it allows to replace the ProjectGeneratorInvoker with own implementation, overriding the creation of the ProjectGenerator with own sub-classed version and use that instead of the original one.

In addition, the transient modifier of the temp files seems to be unneeded, since the ProjectGeneratorInvoker should not be serialized/deserialized, transient is not used in any other place in the project and is a little surprising at that location.

@pivotal-cla
Copy link

@zambrovski Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 8, 2024
@pivotal-cla
Copy link

@zambrovski Thank you for signing the Contributor License Agreement!

@mhalbritter mhalbritter added type: enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 11, 2024
@mhalbritter mhalbritter self-assigned this Nov 11, 2024
mhalbritter pushed a commit that referenced this pull request Nov 11, 2024
Also remove an unneeded transient modifier.

See gh-1582
@mhalbritter
Copy link
Contributor

Thank you very much and congratulations on your first contribution 🎉!

@mhalbritter mhalbritter added this to the 0.22.0 milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants