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

HibernateClinic in PetClinic sample should use constructor-injection instead of field injection [SPR-5326] #9999

Closed
spring-projects-issues opened this issue Nov 26, 2008 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Alef Arendsen opened SPR-5326 and commented

In HibernateClinic (org.springframework.samples.petclinic.hibernate) we're using @Autowired field injection right now. This should be changed to use constructor injection. We promote the use of constructor injection all over the place and also not doing field injection in your business logic and this is precisely what we're doing here...

Attaching a patch. Not tested (can't get the workspace up and running right now, so please test before committing).


Affects: 2.5.6

Attachments:

Referenced from: commits fe31de5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants