Skip to main content

What is spring framework. How is it different from other framework ?

 Introduction to Spring Framework:

Spring is a framework and Struct is also a framework But now most of us use Spring frameworks.

Conclusion

Struct is not a complete application development framework.

Spring is a complete application development framework.

Monolith Vs Microservices

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

=> If we develop all the functionalities in a single project then it is called as Monolith Architecture based application.

=> In Microservices architecture, functionality will be divided into several apis.




What is spring framework. How is it different from other framework?

1) What is Programming Language?

-> Programming Language used by humans to communicate with Computers.

-> Programming Language contains a set of instructions & syntaxes

Ex: C, C++, Java, C#, Python, etc.....

2) What is Framework?

-> Framework means semi-developed software.

-> Frameworks provide some common logic which are required for application development.

Ex: Hibernate, Struts, Spring, etc...

-> If we use the framework in our application development then we need to focus only on business logic.

   (frameworks will provide common logics required for our application)

Hibernate : It is an ORM framework. Used to develop only persistence layer of our application .

Struts : It is a web framework. Used to develop only web layer of our application.

Spring : It is an application development framework. Entire project can be developed by using this.

(we can do application end to end development)

 Spring Boot is just one approach to develop Spring Based applications with less configurations.

=> Spring Boot came into market with Auto Configuration concept.

Note: Spring Boot will take care of configurations required for our application.

=> We can do rapid development using Spring Boot.

Spring Advantages

-> It is a free & open source framework.

-> Spring is very light weight framework.

-> Spring is versatile framework .

(Spring can be integrated with any other java framework available in the market)

-> Spring is non-invasive framework .

(spring framework will not force us to use framework-related interfaces or classes)

Ex: To create a servlet we need to implement a Servlet Interface or we need to extend Http-Servlet or Generic-Servlet.  That means Servlet is forcing us to use Servlet-specific interfaces or classes.

Note: In Spring we can create a simple pojo and we can ask spring to execute our pojo.

-> Spring works based on POJO and POJI model

POJO : Plain old java object

POJI : Plain old java interface

-> Spring is not a single framework. It is a collection of Modules

Spring Modules

1) Spring Core

2) Spring Context

3) Spring DAO / Spring JDBC

5) Spring AOP

6) Spring ORM

7) Spring Web MVC

8) Spring Security

9) Spring REST

10) Spring Data

11) Spring Cloud

12) Spring Batch etc...

Note: Spring framework is loosely coupled. It will not force you to use all modules.

-> Based on project requirements we can choose which modules we need to use from Spring.

Note: Spring Core is the base module for all other modules in Spring. To work with any module in spring first we need to know Spring Core module.

---------------------------------------------------------------------------

-> Spring Core Module is a base module in Spring Framework. It is providing IOC container & Dependency Injection.

Note: IOC & DI are fundamental concepts of Spring Framework.

-> Spring Context module will deal with the configuration-related stuff

-> AOP stands for Aspect Oriented Programming. Spring AOP is used to deal with Cross-Cutting logic in applications.

Application = Business Logic + Cross-Cutting Logic

Note: We can separate business logic and cross-cutting logic using the AOP module.

-> Spring JDBC / Spring DAO module used to develop the Persistence Layer

-> Spring ORM module is used to develop the Persistence Layer with ORM features.

-> Spring Web MVC Module is used to develop Web Applications. 

-> Spring Security module is used to implement Security Features in our application

(Authentication & Authorization)

-> Spring REST is used to develop RESTFUL services (REST API)

-> Spring Data is used to develop the persistence layer. It provided pre-defined repositories to simplify CRUD operations.

-> Spring Cloud provides Cloud concepts like Service Registry, Cloud Gateway, Filters, Routing, FeignClient etc..

-> Spring Batch is used to implement Batch Processing in our application. Batch Processing means bulk operation.

-----------------------------------------------------------------------------------------------------------------------------

-> Spring Framework released in 2004 (First Production Released)

-> The current version of Spring is 6.x version (Released in 2017)

Note: Reactive Programming support added in Spring Framework 5.x version.

Note: Spring Boot 1.x released in 2014.

          -> The current version of Spring Boot is 3.x version.

Note: Spring Boot is an extension of Spring Framework.


Comments

© 2020 The JavaDS Hub

Designed by Open Themes & Nahuatl.mx.