Lesson 1 Flashcards

1
Q

Spring

A
  • It is a framework
  • Used for building Java applications and services
  • Hosts java libraries
  • Has very useful and essential web development “components”, i.e. DB access, security, cloud deployment, web services
  • Streamlines the experience of writing code in Java
  • It’s fast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Web development basics (3 parts)

A

1) Data storage
2) Services (application logic)
3) Client

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

Spring beams/services

A

Spring beams/services are used to write application logic. They are basically Java classes that Spring knows about

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

H2

A

H2 is an in-memory SQL database that Spring Boot will run alongside our business logic.

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

Controller beam

A

The client interacts with the controller beam, which will then send an HTML request and usually expects HTML in return

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

Spring Boot

A
  • Spring boot is part of the Spring framework. Internally, spring boot is built on top of the Spring framework.
  • Helps in rapid application development
  • Helps to develop stand alone and enterprise web applications
  • Used by all SDLC stakeholders
  • Powerful tool for building servers (to connect simultaneous users on different clients)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Thymeleaf

A

Thymeleaf is an HTML template engine, which gets populated using Spring Boot. Thymeleaf allows you to show web pages to a client and populate data on the page using server code.

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

When should you use Java versus another coding language?

A

Java should be used to build any web application, but should not be used to build anything high-performance (such as a graphics processing application)

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

Maven

A

Maven is a java dependency manager

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

HTTP

A

HTTP is a binary format of data. It’s used for communication between programmes over the web. It can be broken down into requests and responses.

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

What is the role of a web server?

A

A web server’s primary role is to listen for an HTTP request, then sending a response to the client.

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

Java Application server

A

An application server is used to process concurrent requests and send response messages out to many clients.
Examples of application servers are: Apache Tomcat, Glassfish, Netty, Wildfly. Spring boot has an embedded application server which includes Apache Tomcat by default.
Java Application Server is a pluggable architecture that can host many deployed applications at once.

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

Multi-threading, request filtering, resource sharing to each application are all things done by the Java application server. What are multi-threading and threading?

A

Threading is basically one track of computation.

Multi-threading is running multiple threads in parallel.

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

Application server

A

A programme that hosts other (and multiple) applications. It forwards requests to the correct application according to a filter.

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

Pluggable architecture

A

A pluggable architecture refers to any piece of software that can be added, replaced or removed.
More often than not, every pluggable component has a common interface.

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

Servlet

A

A servlet is the interface connection between the app that has been developed and the app server that it runs on.
The server sends requests to endpoints in your application. Each servlet represents a configurable endpoint for client connections.

17
Q

How does the server find servlets in an application?

A

1)deploy the application to the server
2)server scans the application files for a web.xml file
The web.xml file tells the server which servlets are in the application and which urls they match to.
3)The server uses Java’s reflection API to load the relevant servlet classes and prepares to manage them

18
Q

What is the life cycle of a servlet?

A

1) Java’s reflection API loads the relevant servlet classes
2) This instance of our Servlet is what the app server will use to process incoming requests. It will remain in memory until the app server shuts it down.
3) The app server calls the .init() method. This triggers any initialisation logic we gave this method.
4) for an incoming request, the app server calls the .service() method which triggers our servlet’s request handling logic.
5) when the servlet is ready to be shut down, the app server calls the .destroy() method