“The Power Of Spring :Simplifying Java Development…”
Java Spring Boot Series…
What is mean by Framework?
Ans: It is a template of a working program that can be selectively modified by adding code.
What is Spring Framework ?
Ans: Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications. Spring handles the infrastructure so you can focus on your application.
About 20 years ago, in 2003, the Spring framework was introduced by Rod Johnson.
Do you think it’s a outdated framework? However, it is not an outdated framework, it is constantly updating, and it still ranks first among all Java frameworks.
After introducing Spring Framework in 2003,but I started learning it in 2023.
Spring framework belongs to JAVA EE flavour. It is an open-source framework created to simplify the development of Java-based applications.
I started learning through YouTube tutorials and browsed several websites. When I started learning, I was very confusion about what actually framework is and how it works. As my learning journey continued, I made the decision that I don’t want to go understand internal working or configurations . Just copy and paste the code from the website and executed it on my device.
It’s fun to watch movies on OTT every Friday,
We don’t care about the filmmaking process of how the scene was shot, we just enjoy the action. We just wanted to know about the hero, heroine, and director.
Similarly, when starting a framework, you should not be too involved with it and just focus on the output.
As you progress, you will be sure to understand the internal working and configurations.
Spring Modules
Test
This layer provides support of testing with JUnit and TestNG
Spring Core Container Contains the following:
Core and Beans
It provide IOC and Dependency Injection features.
Context
It supports internationalization (I18N).
Expression Language
It provides support to setting and getting property values, method invocation, accessing collections and indexes, named variables, logical and arithmetic operators, retrieval of objects by name etc.
AOP, Aspects and Instrumentation
These modules support aspect oriented programming implementation where you can use Advices, Pointcuts etc. to decouple the code.
Data Access / Integration
This group comprises of JDBC, ORM, OXM, JMS and Transaction modules. These modules basically provide support to interact with the database.
Web
This group comprises of Web, Web-Servlet, Web-Struts and Web-Portlet. These modules provide support to create web application.
Get Spring Techie’s stories in your inbox
Join Medium for free to get updates from this writer.
Don’t worry or try to remember. We will take a closer look at each in future blogs.
Let Jump to build simple Application without any delay
preRequisite:
Must have a good knowledge on Core Java.
Must know Constructer & Object Creation .
Must Know Interfaces and Inheritance concept.
Must download either STS or Eclipse.
Must have MYSQL Work Bench or other databases.
There are 5 steps to create Basic Spring Application.
- create Java Project and the jar files under
Right click on project the
Build Path → configure Build path → under library tab → click on Classpath → click on Add External jar → apply and close →
Link for jar files .jar(click here).
2.create Java Class (a Model class).
package com.spring.java;
public class Student
{
private String name;
private int rollno;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getRollno() {
return rollno;
}
public void setRollno(int rollno) {
this.rollno = rollno;
}
public Student() {
}
}3. Create the xml file name it as config.xml.
In this file we are going to create beans (Don’t get confuse word bean it is just a object )
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id = "student" class = "com.spring.java.Student">
<property name = "name" value = "Pavan"/>
<property name = "rollno" value = "101"/>
</bean>
</beans>4.Create the test class.
Here we are getting the object of Student class from the IOC container using the getBean() method of BeanFactory.
package com.demo.springmedium;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Test
{
public static void main( String[] args )
{
ApplicationContext context=new ClassPathXmlApplicationContext("config.xml");
Student stu= (Student) context.getBean("student");
System.out.println(p.getName());
System.out.println(p.getRollno());
}
}Don’t try to understand search for the words ClassPathXmlApplicationContext , ApplicationContext.
I will explain one by one in upcoming blogs.
Just copy paste the codes in your IDE.
FUN FACT:
Why is Spring Framework called Spring?
His reasoning was association with nature (having noticed that I’d trekked to Everest Base Camp in 2000); and the fact that Spring represented a fresh start after the “winter” of traditional J2EE. We recognized the simplicity and elegance of this name, and quickly agreed on it.








