ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Twelve Best Practices For Spring XML Configurations
Subject:   Good Citizen
Date:   2006-01-26 06:36:31
From:   wireframe
I disagree that setter injection is better than constructor injection. Failing fast at startup if dependencies are not provided, is always better than failing at runtime if a developer forgot to set the dependency.

And implementing "InitializingBean" to check that the setter was called is a complete hack. It couples your service to spring for management of it's lifecycle.

1 to 2 of 2
  1. Good Citizen
    2006-02-08 10:43:49  wpoitras [View]

  2. Good Citizen
    2006-02-01 06:41:03  kinko [View]

1 to 2 of 2