Java Spring: An overview
My first encounter with Spring was a college assignment. As someone who wasn’t confident working with Java, I was worried whether I would be able to handle this or not. To my surprise, this technology was quite easy to set up and work with. I was pleasantly surprised by the ease at which even a novice could utilize it. Let us get to know more about this framework.
What is Spring?
Java Spring is basically a framework for the creation of JavaEE applications. As a lightweight framework, it provides several modules e.g. IOC, AOP, DAO, WEB MVC, ORM, etc. (Don’t worry about these short forms right now, we will discuss them later!) It also provides support for other frameworks like Struts, Hibernate and Tapestry. Other frameworks can be easily integrated with our application if we make them with Spring.
Reasons to pick Spring?
1) Predefined Templates
Spring framework provides templates for JDBC, Hibernate, JPA, etc. technologies. You can skip writing a lot of the repetitive code by using these predefined templates. This is also referred to as “Bootstrapping”.
2) Easy to test
The Dependency Injection makes it easier to test the application. The EJB or Struts application requires the server to run the application but the Spring framework doesn’t require a server.
3) Lightweight
Because of its POJO implementation, the Spring framework is quite light. The Spring Framework does not compel programmers to inherit or implement any classes or interfaces.
4) Fast Development
Spring Framework’s Dependency Injection functionality, as well as its support for a variety of frameworks, makes developing JavaEE applications a breeze.
5) Powerful abstraction
It provides a powerful abstraction to JavaEE specifications such as JMS, JDBC, JPA, and JTA. This helps in making our application more secure.
Some useful Spring modules
Test - This layer provides testing support with JUnit and TestNG.
Spring Core Container — The Spring Core container contains core, beans, context, and expression language (EL) modules.
Core and Beans -IoC and Bean Injection are two of the most essential functionality provided by these modules.
Context -This module provides support for internationalization (I18N), EJB, JMS, Basic Remoting.
Expression Language -It is an extension to the EL defined in JSP. It provides support to setting and getting property values, method invocation, accessing collections and indexers, variables, etc.
AOP, Aspects, and Instrumentation -These modules facilitate the use of Advice, Pointcuts, and other decoupling techniques to build aspect-oriented programming. AspectJ integration is supported through the aspects module. Class instrumentation and classloader implementations are supported by the instrumentation module
Data Access / Integration -JDBC, ORM, OXM, JMS, and Transaction modules are all part of this category. These modules are mostly used to help database-driven projects.
Web -Web, Web-Servlet, Web-Struts, and Web-Portlet are all part of this category. These modules aid in the development of web applications.
How to get started with Spring?
Wondering where to start learning about this amazing framework? The best resource would be the official site of Spring Framework itself. They provide you with thorough documentation and lots of projects so that we can learn better! Hands-on learning is Hands-down the best learning!
Check this out: https://spring.io/guides