Spring Flashcards

1
Q

What is Spring?

A

An open-source application framework that provides infrastructure support for developing Java applications. It helps developers create high performing applications using Java. It uses inversion of control (IOC) to turn control of the code to the framework, using dependency injection. This improves speed and efficiency in app development

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

What is dependency injection in Spring?

A

A technique to provide the objects that an object needs (its dependencies) instead of having it construct them itself. There are 3 types: Method (aka interface based), setter (aka property), and constructor injection.

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

What are Spring Beans?

A

Uniquely identified objects that are instantiated, assembled, and managed by the Spring IOC container. Basically, classes that encapsulate many objects into a single object. They function by means of annotations, like @ComponentScan which tells Spring where in the container to find the beans

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

What is application context?

A

The central interface that is responsible for instantiating, configuring, and assembling the beans in the Spring ioc container. It performs the same functions as the BeanFactory with the additions of MessageSource, access to resources, event propagation to beans, loading multiple contexts, etc.

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

Explain Application.Properties file

A

A collection of key:value pairs that represent configuration options and their underlying values in your project. Replaces all XML configuration.

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

What is Spring ORM?

A

Object Relational Mapping. A technique or design pattern used to access a relational database from an object-oriented language. It covers many persistence technologies including JPA (Java Persistence API) which is mainly used to persist data between Java objects and relational databases; Hibernate, Java Data Objects (JDO), and iBATIS SQL Maps

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

What is JPA?

A

Java Persistence API. A specification that defines how to persist data in Java applications. The primary focus of JPA is the ORM layer and is used to examine, control, and persist data between Java objects and relational databases.

Being just a specification, JPA consists of a set of interfaces, like EntityManagerFactory, EntityManager, and annotations that help you map a Java entity object to a database table.

There are several JPA providers, like Hibernate, EclipseLink, or Open JPA which you can use.

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

What is Hibernate?

A

Hibernate is an open source object relational mapping (ORM) tool that provides a framework to map object-oriented domain models to relational databases for web applications. ORM is based on the containerization of objects and the abstraction that provides that capacity. Abstraction makes it possible to address, access and manipulate objects without having to consider how they are related to their data sources.

Any changes made are encapsulated in the data source itself, so that when those sources or their application programming interfaces (APIs) change, the applications that use ORM don’t have to make changes or even be aware of that information.

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

Spring Data JPA vs JPA

A

Spring Data JPA is part of the umbrella Spring Data project that makes it easier to implement JPA based repositories. Provides a definition to implement repositories that are supported under the hood by referencing the JPA specification, using the provider you define.

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