The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 A Brief Introduction to IoC
Subject:  Interfaces don't need to change...
Date:  2004-02-10 10:28:44
From:  jcarreira


You wrote:


Another disadvantage is that Spring requires getters and setters for its dependency resolution. You have to expose properties that you might perhaps not otherwise expose, potentially breaking data encapsulation rules and, at best, making a class' interface more complex than is needed.


This is not entirely accurate. Your component Interface does not need to change. It can be purely the business methods your component provides. Your implementation class, however, can have these getters and setters as purely an implementation detail.

 Feed java.net RSS Feeds