Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions