As a Java architect, I’m using Spring as a daily basis.
Spring is a refreshing library in a sense that it allows you to do simply complicated things.
Like using JPA, Jdbc and Hibernate in the same web project but in different transactions.
However, there is one thing very annoying in it:
Spring objects are usually not subclassable.
They always use private members, and most of the time with no getter at all !
That means I cannot change or add behavior to this classes without changing Spring code itself !
For example, there is no way I can access to the underlying xstream object wrapped by the XstreamMarshaller !
I need to configure xstream more than what the Spring XStreamMarshaller offers, but I can’t do it easily.
The Spring objects are obviously well-designed and thought-out, but they cannot offer all the functionalities needed by all the projects !
You can explain me that they do this for preventing changes into their objects from impacting project’s code.
As always, I don’t agree with this:
When I subclass a class, I’m really heavily coupled to it, especially in Java where you cannot extends more than one class.
So i’m heavily dependent on the base class. I have never seen big changes in a base class not impacting derived classes !
I think this would be a good thing if Spring allows us to use their classes like standard Java classes.
GC.