Springboot Flashcards

1
Q

What is Springboot?

A

An open-source framework that simplifies the creation and development of web-based applications in Java

Allows developers to focus on writing business logic, rather than configuration

Provides pre-configured components, opinionated defaults, and a command-line interface that facilitates the creation of production-ready applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between Spring and Springboot?

A

Spring Boot is a more streamlined version of Spring that simplifies the configuration process and provides an out-of-the-box experience

Spring is a more modular and customizable framework that provides a wider range of features but requires more configuration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the default port used by SpringBoot?

A

8080

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the advantages of using Spring Boot?

A
  • simplified configuration
  • auto configuration
  • faster development
  • out of the box experience
  • easy configuration
  • large community support
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Bean in Spring Boot?

A

An object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you create a RESTful web service using SpringBoot?

A
  • Create a new Spring Boot project using your preferred IDE or by using Spring Initializr.
  • Add the necessary dependencies to your project, including spring-boot-starter-web.
  • Create a new Java class that will serve as the REST controller. This class should be annotated with @RestController.
  • Define methods within the controller class that will handle HTTP requests from clients. These methods should be annotated with the appropriate HTTP method annotation (e.g., @GetMapping, @PostMapping, @PutMapping, @DeleteMapping).
  • Define the URI mappings for the methods using the @RequestMapping annotation.
  • Define the response types for the methods, which can be a simple data type (e.g., String) or a custom class.
  • Run the Spring Boot application, and the RESTful web service will be available at the specified URI.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an application.properties file in Spring Boot?

A
  • Port number
  • Database connection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a DTO?

A

A data transfer object is a design pattern that lets us transfer a group of info at one time

Ie. instead of fetching info about customers one at a time, you could make a class
customer DTO {
setFirstName..
setSecondName..
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly