Server Side APIs Flashcards

1
Q

Frontend

A

Provides functionality for the user. It deals with the user input and showing output to the user.

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

Backend

A

Provides data, algorithms, and logic for the frontend to use.

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

Model View Controller (MVC)

A

Is a pattern that divides the application based on responsibility. The end result is that the Model and View are unaware that the other exists. This decouples the Model and View.

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

Model (MVC) characteristics

A
  1. Application state and business logic.
  2. Only part of the application that talks to the database.
  3. Model could be classes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

View (MVC) characteristics

A
  1. Presents data to a user.
  2. Accept input from a user.
  3. Views might be a desktop display, a mobile display, a file output based on a model.
  4. The View is not the output HTML/UI that displays in the browser or device, it is the code that generates the response.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Controller (MVC) characteristics

A
  1. Takes input from the view and passes it to the appropriate model objects.
  2. Grabs all necessary building blocks and organizes them for the output.
  3. Takes results from the model and passes them to the appropriate view.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Dependency Injection

A

Is a design pattern that implements IoC. It inverts control of the instantiation of dependencies from the class using them to a dependency injection container. Rather than instantiating classes with “new” in our class, they will be injected into our class at runtime.

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

Inversion of Control (IoC)

A

Is an object-oriented principle that inverts the flow of normal flow of control of an application from a class to a higher layer. It is commonly used in Java Frameworks.

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

Dependency Injection Container

A

Is code that creates and injects the dependencies into our class. Spring has a Dependency Injection Container built into it.

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

Dependency Injection in Spring Boot

A
  1. Create an Interface with an Implementation class (CityDao).
  2. Add the @Component annotation to the implementation class (JdbcCityDao).
  3. Declare an argument of a constructor using the Interface
    public CityController( CityDao cityDao)
  4. Or a variable can be created with the @Autowired annotation but can make Integration/Unit testing more difficult.
    @Autowired
    private CityDao cityDao;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

RESTful Service Design - End Points

A
  1. Endpoints should be plural names that define what is being accessed (the entity - hotels, reservations, cities, etc).
  2. IDs should be sent as Path Variables.
  3. Filters and Sorting should be sent as Query Parameters.
  4. Endpoints should reflect the hierarchy of the entities.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

RESTful Service Design - CRUD

A
  1. What do you want your user to be able to Create? (POST)
  2. What do you want your user to be able to Read? (GET)
  3. What do you want your user to be able to Update? (PUT)
  4. What do you want your user to be able to Delete? (DELETE)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

HTTP Response Status Codes

A

2xx Status Codes can be applied to a controller method using the @ResponseStatus annotation.
4xx Status Codes can be returned by throwing an Exceptions from the Controller Method.

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