In my view, frameworks like Spring provide the following benefits:
- Allow for cleaner separation of layers
- Automatically apply certain well established design patterns
- Externally configurable (see below)
- Structured to support plug-and-play of components
I understand that too much of XML can be quite confusing. For instance, I had the same issue with all the action-mappings within Struts. However, I soon realized the reason why such frameworks were configuration intensive, be it XML or annotations. Most of these frameworks are general purpose in nature. For instance, you could use Spring to run a web application, an
RMI application, or a batch application. Being configuration intensive is what makes these frameworks more flexible, for use in different environments. You cannot therefore blame such general purpose frameworks for being configuration intensive. It is the users of such frameworks that are responsible for balancing flexibility against manageability. That also applies to the use of features like Dependency Injection, externally configurable transactions, etc.
I have a different opinion on O/R mapping tools like Hibernate and
TopLink. In the past, I had worked with
TopLink to quite an extent. What I realized was that such mapping tools were a good fit if the domain object model was the driving force behind the relational data model. Any other way, and you had mapping issues. Also, at that time
TopLink did not support stored procedures, and the applications relied quite heavily on them.
A good alternative would be a data mapping framework like
iBatis. You write the
SQL, and
iBatis executes it for you, without you having to write a single line of
JDBC related code. Along with that, it also manages all database related resources (statements, connections, result sets, etc) for you.