Spring is a popular open-source Framework for developing J2EE applications. Its first version has been written by Rod Johnson who published it with his book Expert One-on-One J2EE Design and Development in October 2002. It was first released under the Apache 2.0 licence in June 2003.

Why was Spring created?

The basis for creation of the Spring Framework was to facilitate the development of enterprise applications.

Key features of this process:

  • Removing close program links between each POJO objects and layers using the Inversion of Control model.
  • Options to choose the implementation of the business layer EJB or POJO for the application architecture and not vice versa (when the architecture prescripts the implementation).
  • Solving different application domains without needing to use EJB. This was reflected, for example, in transactional processing, in support for remoting the business layer using web services or RMI.
  • Support for the implementation of components used to access data in the form of JDBC or ORM (object-relation mapping) technologies and tools of the Hibernate, TopLink, iBatis or JDO type.
  • Removing dependencies on different multiple configurations. Finding their meaning was extremely difficult.
  • Abstraction leading to simplification of use of other parts J2EE, such as JMS, JMX, JavaMail, JDBC, JCA or JNDI.
  • Simplicifaction of writing and using unit tests.
  • Management and configuration management of business components.

The advantages of using Spring.

  • No need to reinvent the wheel. One of the greatest benefits is the fact, that developers can use familiar technology, ORM frameworks, logging frameworks, JEE, JDK timers, Quartz and others. Thus, developers don’t need to learn new technologies or frameworks.
  • Testability. If you want to test applications that are being developed using Spring, it’s relatively simple. The main reason is that a code dependent on the environment is available within the framework.
  • API. Spring Framework offers inversion control and API translating technology controlled exceptions, specifically fired within JDBC, Hibernate or JDO to consistent exceptions.
  • Modularity. Because of the modular organization, it is easier for developers to know in Spring, which packages or classes to use and which should be ignored. It doesn’t depend on the number of packages and classes, developer will find usable ones relatively easily thank to this feature.
  • Consistent transaction management. Using an interface for consistent transaction management, it is easy to scale Spring up and down within both local and global transactions.
  • AOP. There is no need for the developer to have a separate compilation unit or a separate class loader. Meanwhile, he uses IOC for dependency injection, which makes the configuration even easier.

The disadvantages of using Spring

  • Complexity. One of the biggest points of Spring criticism is that it is very complex. It hasn’t a clear focus, instead, it has more than 2400 classes, 49 other tools and many other connections that make it even more complicated.
  • More demanding to learn. For beginning developers, Spring Framework is relatively difficult to understand. It contains a wide range of new programming methods and requires a deep knowledge of how to set up the XML configuration file.
  • XML. All applications in Spring require many XML.
  • Parallel mechanisms. Parallel mechanisms are very useful, but there are really many of them in Spring which is more confusing as a result. It is necessary to allocate a disproportionate amount of time to choose the appropriate method.
  • Security Best Practices. There aren’t clear instructions, how to deal with security threats. Spring has several security gaps and there is no generally accepted procedure, how to defend against normal attacks.