Transcript for:
Layered Architecture and Spring Framework

good morning guys in the last session we started discussion related to layered architecture so we are going to develop a project by using this layered architecture layered architecture means developing our application with Loosely coupling so multiple layers will be available in the project like presentation layer will be available web layer will be available service layer will be available and persistence layer will be available persistence layer contains the logic to communicate with the database in order to develop persistence layer earlier we used to work with jdbc but there are some problems with the jdbc we need to write lot of Boer plate code in the jdbc to avoid that we are using hiber net hiber net is a framework what is the benefit of using framework what is the benefit of using Frameworks framework will provide some common Logics required for the application we need to focus only on the business logic development we can save our time if you develop the project by using framework concept next one service layer will be available service layer will be available so service layer contains business logic service layer contains business logic so to implement that business logic we can go for Java or we can go for some third party libraries also and next one web layer will be available in the project what is the meaning of web layer what is the meaning of web layer web layer contains controllers controllers are used to handle request and response in order to develop that web layer we can use serlet serlet is a technology what is the problem with serlet technology we need to write a lot of logic we need to write lot of code to deal with our application development to overcome the problems of the Surat people are using struts struts is a framework so by using struts we can develop web layer next one view will be available nothing but presentation layer presentation layer contains user interface earlier people used to develop presentation layer by using JSP later point of time they realized challenges with the JSP now people are using angular or react to develop presentation layer now seret struts we can use to develop web layer jdbc hibernate we can use to develop persistence layer now culet is a technology jdbc is also a technology when you use jdbc seret lot of boiler plate code we need to write to develop the project to avoid that problem people started using Frameworks Frameworks came into picture to develop our application what is framework what are the advantages with the framework what is a framework what are the advantages with the framework framework is a semi developed software that means in the application development two types of Logics will be available one is common logic second one is business logic business logic will change from application to application banking business logic educational applications Telecom applications e-commerce applications right so application to application business logic will be different but for all the applications some common Logics will be available connections statements result set form data form validation convert the form data to object these are the common Logics for all the application so if you write Common logic and business logic it will take more time so to simplify the development process we are going to use framework what is the advantage with the Frameworks if you are using Frameworks then you can focus only on the business logic Frameworks will provide common Logics required for the application now advantages you don't need to write the same code again again in the Frameworks and fast development will be faster because some logic they will provide only some logic you have to write less number of code will be available no number of bugs will be less maintenance of the project also will become easy when you develop that project by using Frameworks all right then after we started understanding already struts available hiber net is available to develop a project but what is the problem with the struts and hibernate what is the problem with struts and hibernate struts a framework to develop only web layer in the application hnet is a framework to develop only persistence layer in the application so I need to download two different Frameworks to develop one application but I'm looking for your solution I need one framework which supports for my entire application development I want a single framework which supports entire application development that's where spring framework came into picture what is the spring what is the spring guys spring is an application development framework already STS framework is available hibernate framework is available then why spring framework became very popular in the market by using struts you cannot develop entire project by using hibernate also you cannot develop entire project but by using spring we can develop entire project spring is called AS application development framework spring is providing the support for end to end application development and this spring is Java based framework and spring is free of cost spring is free of cost you don't need to purchase the license of the spring you can download that spring and you can use that spring in your project you can develop entire application by using spring if you are using spring you don't need to download struts you don't need to download hibernate spring will support for everything to develop your application in which year that spring framework came into picture spring came into picture in the year of 2004 but it took four to five years in the industry to realize the advantages of the spring framework till 2008 2009 starts framework very popular in the market from 20110 onwards people started using spring framework to develop the project what what is the current version of the spring the current version of the spring is 6.x version the first version of the spring released in the 2004 in the 2022 the spring 6.x version got released to use spring 6.x version Java 17 is mandatory the spring 6.x version is developed based on Java 17 version now let's understand spring architecture let's understand spring architecture spring is not a single framework guys spring is developed in modular passion spring framework developed in modular passion that means in the spring framework there are multiple modules are available if you see the spring architecture then you will understand spring architecture spring architecture now so if you see one minute yes now so this is architecture of the spring I can show you like this can you see this diagram now this is called the architecture of spring framework copy the image yeah so this is called our spring architecture now spring is not a single framework spring framework developed in modular passion so there are several modules available in the spring framework as I told you by using spring we can develop entire application so to develop all the layers of the application spring framework provided several modules the base module in the spring framework is core module how we have core Java similarly there is a spring core module spring core module is the base module of the spring framework which will tell all the fundamentals available in the spring framework then similarly we are having spring aop module and we are having spring jdbc module spring warm module spring web module spring serlet module spring aop module spring beans spring core spring context spring test like this there are several modules available in the spring framework spring is not a single framework spring is developed in modular passion sir why these many modules available in the spring these modules are going to support your endtoend application development they are going to support end to endend application development so spring framework developed in modular passion we have several modules we have several modules in the spring framework like below there are several modules available the first module is is called as spring core module the first module spring core module and the next one spring context module core module is available context module is available then spring aop module is available we will understand what is the purpose of each module okay so if you learn how to work with these modules then we can say we can develop the project by using spring framework spring is application development framework it is developed by using Java and this spring framework is free of cost the first version of the spring released in the 2004 the current version of the spring is 6.x version this spring framework is not a single framework this spring framework is developed in modular fashion there are several modules in the spring framework what are the modules available the first one is spring core module the second one spring context module the third one spring aop module the fourth one spring jdbc module we can also call this as spring spring Dao module we are having spring jdbc module we can also call this module as spring Dao module along with that along with that we are having one more module that is called as spring warm module we have another module called Spring omm apart from this we are having a module called Spring web module we can say spring web MVC module is available then similarly we are having Spring Security Spring Security is available then spring batch is available spring cloud is available spring cloud is available spring data is available like this there are 20 plus modules in the spring framework there are 20 plus modules available in the spring framework some of the important module names I have mentioned here so could you please tell me what is the spring come on spring is a framework what is the meaning of framework what is the meaning of framework framework is a semi-developed software which will provide common Logics for application development framework is a semi-developed software which will provide common Logic for application development if you use the framework you can focus only on the business logic development within the less time you can develop more code you can write more code to complete your application there are several types of Frameworks available struts is available hibernate is available spring is available what is the difference between struts and spring stuts is used only for web layer development hibernate is used for only persistence layer development I want a single framework to develop entire application that's where spring framework came into picture from which year spring is available from 2004 the spring 1.x version is available what is the current version of the spring the current version of the spring is 6.x version spring modules spring framework is a developed in modular passion spring is developed in modular passion there are several modules available around 20 plus modules available in the spring framework for all the modules which is the base module which is the base module spring core module is the base module can you read the names of the spring modules first one is spring core second one spring context third one spring aop fourth one spring jdbc spring jdbc also called as spring Dao then next one spring warm spring warm is available next one spring web MVC module Spring Security spring B spring Cloud spring data like that there are several modules available in the spring framework another Beauty with the spring suppose if you want to develop only persistence layer by using spring you no need to use all the modules of the spring if you want to develop a persistence layer you can take only spring jdbc module you can use that all the modules in the spring these modules are Loosely coupled these modules are Loosely coupled so spring framework will not force to learn all the modules or to use all the modules spring framework is Loosely coupled framework every module is Loosely coupled core module is available aop is available jdbc orm available web module is available messaging module is available is there any relation between one module to another module no the that that means the modules are independent spring modules are independent so there is no rule that you need to use all the modules in the project which module is required you take only that module to use in the project it's not mandatory to learn all the modules it's not mandatory to use all the modules spring is developed in modular passion and these modules are Loosely coupled these modules are independent whichever the module is required for your application you take only that module used in your project so that is the meaning of loosely coupled modules Loosely coupled modules for example I am working on my project development my project having web layer service layer and persistence layer is available I started my project by using struts the web layer I'm developing by using struts framework web layer I'm developing by using struts framework here my service layer is available okay now I want to develop Dao layer to communicate with the database now I want to develop only I started my project with the struts framework I started my development STS Pro struts framework I'm using to develop web layer in my application okay now I want to develop D layer when I am going to develop the D layer I came to know about the spring framework initially when I'm starting the project development I don't know about the spring I don't know power of the spring framework I started the project with the struts by using struts can I develop entire project no by using STS I can develop only web layer in the project now I want to develop my D layer by using spring framework I want to develop D layer by using spring framework do I need to use all the modules in the spring no only this D layer we can develop by using spring framework now I will develop Dao by using spring Dao model module or I can use spring warm module so that means you no need to use all the modules of the spring it is not mandatory to use all the modules spring framework is Loosely coupled whatever the module is required for your application you take only those modules and you use in your project so that is the reason spring framework can be integrated with other Frameworks in the market can I use the combination of struts and spring yes we can do that so if you want to use spring only for D layer persistence layer you can do that suppose I want to use the spring per web layer also if you want to use the spring per web layer then you can go for a module called Spring web MVC module spring web MVC module is used to develop web layer spring Dao module used to develop persistence layer so like this there are several modules available in the spring framework all the modules are Loosely coupled spring framework is developed in modular passion so all the modules in the spring are Loosely coupled what is the meaning of loosely coupled what is the meaning of loosely coupled spring modules are Loosely coupled so what I can say these modules are independent is it mandatory to use all the modules in the Pro project no for my project I want only security by using spring I will use the strs for web layer I will use Doo by using hibernate I want security for my project that security can be developed by using Spring Security so whichever the module is required for your project you can you can use that module you can develop your project that is called loely couple spring framework developed in modular pass spring modules are Loosely coupled so there are several modules available what are those modules can you read them now what are the modules available spring core module is available spring context module spring aop spring jdbc or spring VM spring Dao or jdbc both are same jdbc Dao both are same next one spring warm next one spring web MVC next one Spring Security spring batch spring Cloud spring data like that there are several modules available in the spring is it mandatory to develop a project with all the modules no we can use any module we can use any module based on our project requirement it's not mandatory to use all the modules whatever the module is required for your application you can take only that module and you can develop your project now first let's understand what is spring core module we are going to learn spring core module first because to work with the spring framework or to work with the spring boot the spring core module knowledge is required what is the spring core module it is base module in the spring it is base module in the spring framework it is providing this spring core module is providing fundamental concepts of the spring it is providing fundamental concepts of spring what are those fundamentals one is ioc container second one is dependency injection third one is auto wiring one is ioc container second one is dependency injection third one is auto wiring these are fundamental concepts of the spring framework to develop a project we need to use ioc container dependency injection Auto wiring to develop a application by using spring so these fundamental concepts are providing by which module spring core module using spring core you can develop only Standalone application okay we can develop we can develop Standalone application using core module so core modu module is providing fundamental concepts of the spring framework so what are the fundamental concepts of the spring ioc container dependency injection Auto wiring now why we need to use these fundamental concepts using spring core using spring core we can develop application classes with loely coupling okay as of now as of now if one class want to call another class method for example I have a controller how my controller will call the Dao how my controller will call the Dao Ser controller is calling service service is calling Dao controller class should call the service class method service class method should call the D class method how one Java class method will call another Java class method by creating the object or by inheriting the properties if you create the object if you inherit the properties classes are tightly coupled one class should create the object of another class but if you go for the spring framework you no need to create the objects ioc container will create the object from now onward we are not going to create object for the classes who will create object for the classes ioc container will create the object where the ioc container available it is available in the spring core module what is the purpose of spring core module spring core module is the base module in the spring framework if you want to develop any application by using spring the mandatory things that we are going to use iOS container dependency injection Auto wiring these three concepts are called fundamental concepts of the spring these fundamental concepts are providing by Spring core module what is the benefit fit with these Concepts guys we can develop application classes with the Loosely coupling so what is that Loosely coupling what is a tightly coupling we will understand with the example so once we start the first application development by using spring then you will understand what is tightly coupling and what is Loosely coupling for time being you remember that spring core module is the base module of the spring that spring core mod module is providing fundamental concepts of the spring what are those fundamental concepts ioc container dependency injection and auto wiring so what is the benefit with the core module we can develop application classes with the Loosely coupling okay good the next one is spring context module there is a module called Spring context spring context module used to deal with configurations in the application so in my application web layer will be available persistence layer will be available business layer will be available which classes should be managed by the spring ioc container should manage the classes ioc container should create the object ioc container should perform the dependency injection all the terminology we are going to learn so here spring context module it is responsible for it is responsible for managing configurations in the application it is responsible for managing configurations in the application where the controllers are available in the project how many controllers are available in the project where the doo classes available in the project for which classes object should be created by ioc container for which class object should not be created by the ioc container that configuration management will be taken care by Spring context module can you tell me what is the context Module come on what is the context module guys spring context module is responsible for managing configurations in the application what is the spring core module what is spring core spring core module is the base module that is providing fundamental concepts what are those ioc container dependency injection Auto iring what is the main benefit of the core module develop the application with the Loosely coupling what is tightly coupling what is loely coupling practically we will understand with the application development now we are just understanding what is the spring architecture what are the modules available in the spring what is the purpose of each module then we will start with core module and we will develop the application then you will understand clearly what what is the tightly coupling what is Loosely coupling what is ioc container what is the dependency injection what is auto wiring are you clear just understand what is the module name and what is the purpose of the module next one spring context module what is the spring context what is spring context the spring context module is responsible for managing configurations in the application okay and the next important important module that is spring aop there is a module called aop aop stands for aspect oriented programming aop we have seen already pop we have seen pop what is pop huh procedural oriented programming procedural oriented programming after that we have seen oop what is oop what is oop oop oop stands for object oriented programming procedural procedure oriented programming object oriented programming is available object oriented programming now aop aop stands for aspect oriented programming okay what is the full form of the aop aop stands for aspect oriented programming what is the main purpose of this aop module okay definition may be little confusing guys aop is used to separate aop is used to separate primary Logics and secondary Logics in the application what is the purpose of aop aop is used to separate primary Logics and secondary Logics in the application primary logic nothing but business logic primary logic nothing but our application business logic secondary logic nothing but cross cutting concerns cross cutting Logics Primary in our application primary logic will be available and secondary logic will be available primary logic is nothing but business logic secondary logic is nothing but cross cutting logic so let's understand with some example now I want to develop One banking application I want to develop One banking application assume that my functionality is amount to deposit my requirement is to develop amount to deposit guys I want to develop functionality for amount deposit if I want to develop this amount deposit I will write one method inside that method I will write some security logic I will write some transaction logic and here my business logic will be available and I will write some auditing logic and I will write some logging so like this in our application we will be having multiple requirements like this if you want to develop a method which is responsible to deposit the amount in the bank okay so now in this method security logic will be available transaction logic will be a aailable actual business logic will be available auditing will be available logging will be available so now if You observe in My Method primary logic secondary Logics are combined in My Method primary logic and secondary logic is combined what is primary logic here business logic that is deposit logic I can say deposit logic this deposit logic is called as our primary logic or I can say this is our business logic now if You observe in this method we combined primary logic as well as business logic similarly I have another requirement for amount to withdraw I have another requirement for amount to withdraw like this so in this logic also what we are going to do here also we we need to write security we need to write the transaction and we need to implement withdraw logic we need to implement withdraw logic auditing will be available logging will be available now if You observe is there any problem in my application what is the problem in my application now so there are two I have taken just two methods guys I have taken just two methods one method is used to deposit the amount another method is used to withdraw the amount now net banking login amount transfer balance checking loan application loan payment transaction account statement generation bill payment credit card bill payment bill recharges so many functionalities will be available in my project now assume that my project is containing 20,000 methods like this in my project there are 20,000 methods available like this in every method primary logic will be available secondary logic also will be available what is the meaning of primary logic primary logic is nothing but actual business logic along with that business logic we will write some security for our methods we will write the transaction for the method we will write audit for the method we will write logging for the method these are secondary Logics these secondary Logics I have to write in 20,000 methods I have I have to write the secondary logic at the 20,000 places I have to write the secondary logic at the 20,000 places so if You observe we are combining primary logic and secondary logic in the application if I combine primary logic and secondary logic in the application what is the problem boiler plate code is the problem tomorrow I want to make some changes to my project security I need to make some changes to my project security then what I need to do I need to modify the logic at 20,000 places so this is the problem if you combine primary logic and secondary logic in the application primary logic is nothing but business logic primary logic nothing but business logic secondary logic nothing but cross cutting Logics secondary Logics nothing but cross cutting Logics so when I say primary logic example amount deposit okay amount withdraw balance check these all comes under primary Logics what is the meaning of secondary Logics example security is one example transaction is one example logging is one example auditing is one example so in every project primary logic will be available and secondary logic also will be available by by default people will combine primary logic and secondary logic in the application what is the problem if I combine primary logic and secondary logic in the application what is the problem if I combine primary logic and secondary logic in the application boiler plate code boiler plate code maintenance will become very difficult tomorrow I want to make some change to the security then I need to change at 20,000 places after changing again we have to test our code is working as expected or not so lot of maintenance problems will come if you combine primary logic and secondary logic in the application so that's why what we are going to do we will develop our application by using aop stands for aspect oriented programming there is no relation between oop pop and aop aop is a separate that is a spring module aop stands for aop stands for aspect oriented programming why we are going to use the aop aop is used to separate primary Logics and secondary Logics in the application so what is the problem if you combine both if I develop my application like this what is the problem guys boiler plate code boiler plate code maintenance will become very difficult so that's why in the real time what we do we will develop security logic we will develop security logic we will develop transaction logic we will develop auditing we will develop logging all excuse me all these secondary Logics we are going to develop separately all the secondary Logics we are going to develop separately we should not combine primary logic and secondary logic and my application will contain primary logic amount to deposit amount to deposit will be available amount withdraw will be available and balance check will be available like this we will have several business Logics in the application now we are going to separate application business Logics and application application business Logics and application secondary Logics earlier we combined application business logic and application secondary logic if you combine business logic and secondary logic maintenance problem so that's why what we do in the real time we will develop primary logic secondary Logics separately this primary Logics and secondary logic should be integrated at the time of execution primary logic should be executed secondary logic should be executed they are in the same class are they in the different classes now they are separate primary logic is separate secondary logic is separate but in the runtime my primary logic should be executed my secondary logic should be executed that integration will be taken care by Spring aop spring aop is going to separate them at the compilation time it will integrate them in the run time we will develop primary logic secondary logic separately spring aop module is going to integrate them and it is going to execute now tomorrow when I change primary logic is there any problem for the secondary Logic No why why there is no problem for the secondary Logics primary Logics and secondary Logics are clearly separated and who will execute them aop is going to execute them so always we need to separate primary logic and secondary logic in the application at the time of development at the time of execution they should be integrated that integration part will be taken care by spring aop now if I develop like this what is the benefit what is the benefit how many places I'm writing security logic only one place I'm writing the security logic tomorrow I want to make some changes to security only one place we need to do suppose if I don't use aop in every place I need to write the security if any changes are required I have to modify that at the all the places that will take lot of time this will take less amount of time that's why some people will use spring aop in the project is it mandatory to use aop in the project no spring modules are Loosely coupled if you want then only use it if you don't want you can ignore that so if you want to maintain the project easily if you want to separate your primary logic and business logic then we are going to use aop module we have seen three modules as of now core module context module aop module what is the core Module come on what is core module core module is a base module in the spring framework so it is providing ioc container dependency injection Auto wiring what is the purpose of these three concepts to develop the application with the Loosely coupling next one what is the context module what is the context module context module is responsible for managing configurations in the application then what is aop module aop stands for aspect oriented programming why we need to go for aop module to separate primary Logics and secondary Logics in the application primary logic nothing but business logic secondary logic Logics nothing but cross cutting Logics or we can say helper logic cross cutting Logics or we can say helper logic security transaction logging auditing all these things are comes under secondary Logics these are comes under primary Logics are you guys clear very good next one let's talk about spring jdbc module there is a concept called Spring jdbc module already we have normal jdbc normal jdbc available what is the purpose of normal jdbc what is the purpose of normal jdbc normal jdbc to develop persistance layer spring jdbc also to develop the persistence layer you can develop your persistance layer by using normal jdbc API and you can develop the same requ requirement by using spring jdbc also then what is the difference between normal jdbc and spring jdbc come on what is the purpose of spring jdbc it is used to develop persistence layer in the application it is used to develop persistence layer in the application same thing can be done by using jdbc also now then why to go for spring JD BC huh using spring jdbc we can avoid boiler plate code using spring jdbc we can avoid boiler plate code using spring jdbc we can avoid boiler plate code getting the con register driver I want to register the driver spring jdbc will handle okay I want to get the connection who will handle that spring jdbc will handle that create statement who will handle that do I need to handle this part no spring jdbc will handle that part execute query execute query programmer should handle programmer should handle process result process result spring jdbc will handle okay close the connection who will handle that spring jdbc will handle now see this what is our responsibility what is our responsibility we should only execute the query what about the remaining logic read this read this excuse me all right for every application persistence layer will be available so by using jdbc you can develop the persistence layer but if you use jdbc to develop the persistence layer lot of code we have to write get load the driver get the connection create the statement execute the query process the result close the connection that part we need to do manually all right now if you go for normal jdbc then we have to write lot of code on our own and that code we need to write at multiple places to communicate with the database lot of boiler plate code we need to write in the jdbc to communicate with the database that boiler plate code not only for my project that is common for every project so that's why to avoid that boiler plate code we are going to use the concept called Spring jdbc what is the purpose of spring jdbc guys what is the purpose of spring jdbc spring jdbc is used to develop persistence layer in the application it is used to develop persistence layer in the application by using this spring jdbc we can avoid boiler plate code you focus only on the quy execution part what query you want to execute you focus only on the query execution part the remaining boiler plate code steps will be taken care by Spring jdbc spring jdbc internally will communicate with the jdbc API spring jdbc module internally will communicate with jdbc will communicate with jdbc API our application will communicate with the spring jdbc spring jdbc will communicate with the actual jdbc that jdbc will communicate with the database this spring jdbc is also called as spring Dao spring jdbc module is also called as spring Dao are you clear good now what is the benefit if you are using spring jdbc module what is the benefit with the spring jdbc module easily easily we can develop persistence layer in the application we can avoid boiler plate code in the persistence layer you focus only on the query execution part the remaining steps will be taken care by Spring jdbc can I say it is a framework can I say it is a framework what this framework is doing what this framework is doing it is providing common Logics for us this framework is providing common Logics for us we need to focus only on the business logic it is providing common Logics we need to focus only on the business logic development so I need six steps guys to communicate with the database six steps are required five steps providing by the spring jdbc only one step programmer will take care only Korey execution part is my responsibility the remaining five steps will be taken care by Spring jdbc here that is the purpose of framework what is framework what is framework framework is a semi-developed software what is the advantage with the framework what is the advantage with the framework they will provide common Logics required for several applications development we need to focus only on the business logic development Frameworks will provide the common Logics we need to focus only on the business logic development are you clear good spring jdbc developed on top of the jdbc API by using springing jdbc we can develop persistence layer we can avoid boiler plate code If You observe the steps here everything will be taken care by Spring jdbc only quy execution is our responsibility clear with this point online students are you able to follow me is my voice clear for everyone yes so if you have any questions you can ask me at the end of the session guys okay at the end of the session I will give option to unmute your mic so that you can ask your question so I will share this notes also and video also in the group so please join in that group WhatsApp group for the spring boot link I have shared in the chat box anyone who is not part of that group please join in that okay cool next one there is a module called Spring warm module there is a module called Spring VM warm stands for object relational mapping what is warm guys WM stands for object relational mapping okay so here hiber net is omm framework hiber net is called as hiber net is called called as warm framework so here why we need to go for warm it is also used to develop persistence layer jdbc available to develop the persistence layer spring jdbc available to develop the persistence layer hibernate available to develop the persistence layer spring warm also to develop the persistence layer orm omm will represent data in the form of objects when you go for jdbc they will represent the data in the result set format they will represent the data in the text format but Java is a objectoriented language I want to represent everything in the object format so to represent the data in the object format we are going to use warm we are going to use warm warm stands for object Rel ational mapping warm will represent data in the form of objects so here hnet is a orm framework what we can do with the hiber net what we can do with the hibernate hiber net is used to develop persistance layer Hy bernet is used to develop persistance layer so as we have seen in the layered architecture jdbc is available hibernate is also available able what is the difference between jdbc and Hy bernet what is the difference between jdbc and hnet jdbc will represent the data in the text format hnet will represent the data in the object format that is called object relational mapping so by using jdbc we can develop persistence logic by using hibernate also we can develop persistence logic here instead of using hibernate instead of using hibernate people will use spring warm instead of using hibernate people will use spring warm if you use hibernate 10 lines of code you have to write to insert the record or to retrieve the record if you go for spring orm one line of code okay by using hynet you can communicate with the database you can represent the dat data in the form of objects same thing we can do by using spring VM also what is the benefit with the spring VM we can avoid boiler plate Code common Logics in the hibernate will be taken care by Spring warm spring warm developed spring warm developed on top of H bernet spring warm developed on top of hibernate using spring warm using spring warm we can avoid boiler plate code in Dao layer instead of working with the hibernate directly people are going to use spring VM to develop the projects now let's understand so here when you are developing persistence layer our application will be available application will be available our application can communicate with the jdbc API jdbc API will communicate with the database now see here application is available and application will communicate with the jdbc API jdbc API will communicate with the database this is normal development this is normal development we can develop an application our application will communicate with JD BC API jdbc API internally will communicate with the database guys so this is basic we have done in the advanced Java we will develop a project our project will communicate with the jdbc jdbc will communicate with the database if I don't want to do like this then we will develop one application our application will communicate with the spring jdbc spring jdbc will will communicate with the normal jdbc API that jdbc API will communicate with the database this is other way to develop a project application will be available it will communicate with spring jdbc it will communicate with jdbc API it will communicate with the database now if you see my application can talk to Spring jdbc spring jdbc will talk to jdbc then DBC will talk to database are you clear so what is the difference between approach one and approach two what is the difference between approach one and approach two if I directly communicate with the jdbc API what is the problem huh you need to deal with the driver you need to deal with the connection you need to deal with the statement query everything you are responsible to write everything in the project you need to work on business logic you need to work on common Logics also to avoid that boiler plate code our application can communicate with the spring jdbc what is the benefit if my application communicating with the spring jdbc then what is the benefit come on guys what is the benefit common Logics will be taken care by Spring jdbc you focus only on the query part you focus only on the query part the remaining Logics will be taken care by Spring jdbc but here if you go for approach one or approach two you need to represent the data in the text format okay I want to insert the data or I want to retrieve the data everything we will represent in the text format but I want to represent the data in the object format I want to represent the data in the object format for that what people will do is they will develop application application will be available our application will communicate with the hi bernet application will communicate with the hi bernet what hyber net will do hiber net will communicate with the jdbc API that jdbc API will communicate with the database so this is what people are doing currently okay application is available our application will communicate with the hibern hi bernet will communicate with the jdbc jdbc will communicate with the database right what is the benefit what is the benefit guys what is the benefit first thing is I'm not directly talking to jdbc if I talk to jdbc boiler plate code I'm talking to hibernate what is this hnet it is a warm tool hybernate is called as a warm tool what is the meaning of warm what is the meaning of omm object relational mapping we will represent the data in the form of objects omm stands for object relational mapping it is used to represent the data in the form of objects but here also you need to write some boiler plate code if you go for hi bernet you need to write the boiler plate code how to avoid that boiler plate code how to avoid that boiler plate code by using spring warm application will be available application will communicate with the spring warm application will communicate with the spring warm spring warm will communicate with the hyber net hiber net will communicate with the jdbc hi bernet will communicate with jdbc jdbc will communicate with the database okay so if you directly use the hibernate you need to write some boiler plate code to avoid that boiler plate code in the hibernate we are going to use spring warm module our application will communicate with the spring warm spring warm will communicate with the hibernate hibernate will communicate with the jdbc jdbc will communicate with the database so now people want to develop persistence logic with objects representing the data for that you can go for hi bernet or you can go for spring VM if you go for hibernate you need to write lot of code so if you want to avoid the common Logics in the hibernate then go for spring warm you focus only on the business logic common logic will be taken Tak Care by Spring warm are you guys able to understand but in the industry noways people are using people are using spring data not spring warm okay on top of the spring VM one more module came into picture that is called Spring data module okay so if you go for spring warm if you go for spring warm what we need to do you take care of the query you take care of the query remaining part will be taken care by Spring warm but in the current market you no need to write the query also you no need to write the query also query also will be taken care by our spring data module I want to insert the record you no need to write any query that will generate the query to insert the record I want to retrieve the record you don't need to write anything that will take care of retrieving the record from the table so now the in the industry currently applications are developing like this application will be available our application will communicate with the spring data jpa spring data jpa will communicate with the spring warm spring data jpa will communicate with spring warm spring warm will communicate with the hiber net hiber net will communicate with the JD BC jdbc will communicate with the database so this is the level of development in the market today so in the last session I have shown you one line of code to communicate with the database that one line of code we are writing by using data jpa you no need to write single query also to communicate with the database you just write one line of code to perform croud operations with the database insertion updating deleting retrieving everything will be taken care by Spring data jpa you don't need to write anything you don't need to write anything now our application is going to communicate with data jpa data jpa will communicate with the wmm will communicate with the hi bernet hnet will communicate with jdbc jdbc will communicate with the database is we need to learn this development approach one is what normal jdbc approach two spring jdbc approach three hi bernet approach four spring orm approach five huh currently industry using which approach data jpa so this is is industry standard in the industry people will develop the application by using data jpa why we need to develop application by using data jpa you no need to write the queries also you no need to write the queries also that will be taken care by Spring data jpa without writing single query also your application can communicate with the database no need to get the connection no need of driver no need of statement No need of result set no need of query also no need of query also who will take care of the queries who will take care of the queries spring data jpa will take care of the queries now are you clear what is spring jdbc what is the spring warm what is the spring data spring jdbc spring orm spring data all are used to develop persistence layer only but in the industry currently people are using spring data jpa to develop persistance layer why we need to go for spring data jpa to develop the persistence layer come on no need to write anything you no need to write anything no common Logic No Business logic business logic also will be taken care by data jpa that means query construction query execution data processing everything will be taken care by data jpa are you clear with this perfect look at this sir how can we communicate with the database without query that is power of data jpa data jpa will generate our queries it will write the queries for us it will execute our queries you no need to write anything you no need to write anything look at the diagrams approach one approach two approach one and approach two approach 3 4 5 so what which one we need to focus more now data jpa why H you don't need to write anything the queries also will be taken care by data jpa perfect and next one we are having a module called Spring web MVC module there is a module called Spring web MVC module it is used to develop web applications by using spring web MBC to develop web applications with the MBC architecture it is used to develop it is used to develop web applications with MVC architecture so basically it supports it supports web layer plus you can develop web layer and you can develop presentation layer also by using this spring web MVC so by using web MVC you can develop web layer you can develop web application instead of writing the seret in the application now we are going to write spring web MVC classes to develop our web applications okay so we discussed about we discussed about core module what is the purpose of core module base module to develop applications with the loely coupling ioc container dependency injection Auto wiring those are part of core module and next one spring context module it will deal with the configurations in the application then spring aop module what is the purpose of aop aop stands for aspect oriented programming it is used to separate primary Logics and cross cutting Logics in the application then next one spring jdbc or Dao it is used to develop persistence layer you take care of only query remaining thing will be taken care by Spring jdbc and we have spring ormm you take care of the query remaining things will be taken care by VM it will represent the data in the form of object so apart from this we have a module called Spring data jpa you no need to write the query also you don't need to write the query also everything will be taken care by data jpa to communicate with the database and the next one we have a module called Spring web MVC module what is the purpose of web MVC module what is the purpose of web MVC module it is used to develop web layer it is used to develop web layer in the application if you want to develop a web application by using spring then we are going to use spring web MVC module are you clear good next one there is a module called Spring Security there is a module called Spring security so for every application security is important for every application security is important so security we can secure our applications by using spring security module we can secure our applications using Spring Security this Spring Security mainly provides two Logics one is called authentication one is called authentication second one is called authorization so authentication represents who can access our application who can access our application which user can access what functionality role based access okay so which user caness access which functionality that will be decided by authorization which user can login into our application that will be decided by authentication so in order to secure our applications we are going to use Spring Security concept what is the purpose of web MVC what is the purpose of web MVC web MVC used to develop web layer in the application string security used to develop authentication authorization logic in the application spring data jpa to develop persistence layer in the application spring jdbc also for persistence layer spring aop separate primary and secondary logic spring context to deal with the configuration spring core base module to develop application with the losely coupling core module is providing ioc container dependency injection and auto wiring are you clear with these modules right so there are some other modules also available the purpose of those modules we will discuss in the tomorrow session and we will start with the spring core module from tomorrow okay so we will learn spring core module without spring core module you can't understand the spring framework is this fine good so anybody having any questions offline students you got the clarity what is fr book what is the spring what are the modules in the spring yes what is the spring spring is a application development framework why it is called AS application development framework why it is called application development framework we can develop all the layers in the application by using spring it is free of cost the current version is 6.x spring framework developed in modular fashion there are several modules aailable core context aop jdbc orm data jpa web MVC security like that there are several modules available is it mandatory to use all the modules no modules are Loosely coupled which module is required for you you take only that module using your project are you clear good thank you guys with this I'm stopping for today tomorrow we'll continue yeah online students anybody having any question questions yeah notes I will share in the WhatsApp group you can join in the group notes I'm going to share in the WhatsApp group you can join in that to get that information