asimkilic / n11-TalentHub-Java-Bootcamp-Notes

Patika.dev & n11 TalentHub Java Bootcamp notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is Spring Boot

In 2000 if you want to project in Java for Enterprise you will be using lot of Java EE features and one of them is EJB. Now EJB was quite famous and it wast the best technology available that point and you can achieve run of features like messaging and look up for the entities only problem is it becomes difficult to manage them and of course you are working with entities so they are heavy. That's where these people they came up with a concept of POJOs . Where you can achieve the same features with the help of POJO and they have included that in Spring Framework . Now spring framework provides you this feature of working with ;

  • POJO
  • Dependency Injection
  • MVC
  • REST
  • Security
  • Batch
  • Data
  • AOP

There are so many features provided by Spring Framework so it becomes a framework where you can achieve any business purpose and the best part of Spring Framework it can integrate with other frameworks as well like hibernate and Struts. Now we now Spring is the best framework now. There is one problem. Let me talk about Spring Framework, of course we will be building big applications and when we say big applications, we will be needing some external Java files. So that's one thing we have to work with Java files and the second thing is the configuration. When we are working on the enterprise application we need to add a lot of configuration or we have to convey a lot of stuff . And that's what the problem starts, because if we working on a project we want to focus more on the convention. We're coding by basically not on the configuration because we are developers we don't want spend much time in the configuration. I'm not saying we can like escape all the configuration but we try to focus more one the coding part. Now the thing is Spring is good but we want to focus more on coding and that's where these people who created Spring Framework they though, why don't we create something where as a developer they will focus more on the convention and that's well Spring Boot comes to picture. Now again Spring Boot is not a replacement for Spring Framework because as a developer you are still using Spring Framework. So it doesn't have a per this of thing work you are still using the same framework but in between just to help us. We have Spring Boot because Spring Boot says hey developer i know you want to work on a project and Spring is a best framework the only thing is they said there are some jar files which you have to add. And there's quite fiction we do and don't worry and they're for you. So Spring Boot says i will give you dependency and i will give you the configuration. The main idea of spring boot is to give us a production ready application, so the moment we put a Spring Boot project we don't have to do any configuration, it is runnable and you can deploy it on the pressure server it will do nothing but it will work. We don't have to do any configuration and the more features we want, we can add some features and for those features we can do some small configuration but all the basic configuration will be done by Spring Boot. There is one more thing let's say we have not working on Spring Boot, we are working with normal Spring project. we want to make web application and if you deploy the application what we will do is, of course we need a server may be a virtual server or the cloud server and if we have a server, we need to install Linux server. We have a physical server then we have a Linux OS and on that OS of course we'll be installing a web server or maybe a app server it may be Tomcat of the GlassFish and then on that Tomcat we'll be deploying the war file which we create for web application. So many layers we have and nowadays we are moving towards micro services and we want to make it bit easier for us and that's why Spring Boot says "hey you don't have to actually do all those things by yourself " in Spring Boot it provides us a embedded server which means the application jar files which only create. We will not be making modifies now we're making a jar file and inside the jar file will be having Tomcat, that's an embedded Tomcat on embedded server we can say. So Spring Boot says us, jar file will have a embedded Tomcat which means you can run your project and on any JVM we don't basically need a web server. There now Spring Boot provides to so many features. First one is starter projects because if we want a project let's say if we want to make a web application, Spring will say okay, because I'd Spring Boot starter web (spring-boot-starter-web) it will give us a web project, if we want to work with JDBC, spring boot says okay don't worry we have Spring Boot starter JDBC (spring-boot-starter-jdbc) , you can simply use that and it will give us a ready project, what about the configuration Spring Boot also has Spring Boot Auto Configuration which will do the confusion for us. So that we can focus on the convention not on configuration. Let's say if we want to do some configuration maybe we want to modify qualification maybe we wanted to some manuel configuration. Is it possible? That's Spring Boot provides us the XML files ? And the answer is no Spring Boot will not generate any XML file for us because there is no XML file, then how would we modify if we want to do some configuration, that's where we have a special file which is application.properties we can add the properties which we want. There is quite simple

About

Patika.dev & n11 TalentHub Java Bootcamp notes


Languages

Language:Java 92.4%Language:JavaScript 5.6%Language:CSS 1.1%Language:HTML 1.0%