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. |