Home » Java » Enterprise Java (page 10)

Enterprise Java

Spring Constructor Dependency Injection Example

spring-interview-questions-answers

Welcome to Spring Constructor Dependency Injection Example guide. The Constructor based Dependency Injection is a type of Spring Dependency Injection. The other type of dependency injections are Setter Injection & Field Injection. More on Spring Dependency Injection: Example of Setter Injection in SpringField Injection in SpringDependency Injection – Constructor vs field injectionDependency Injection and Inversion of Control Constructor Based Dependency ...

Read More »

MicroProfile 2.2 BOM import support

java-interview-questions-answers

MicroProfile 2.2 just has been released with updates to the Fault Tolerance, Open Tracing, Open API, and Rest Client APIs. What’s also supported since version 2.2 is the usage of BOM (bill of material) dependency imports. With that approach we can define the MicroProfile version in the dependencyManagement block and use only the desired MicroProfile projects. You use the MicroProfile ...

Read More »

Discover applications running on Kubernetes with Prometheus

java-interview-questions-answers

Prometheus supports scraping multiple instances of an application. Applications that run in orchestrated environments require to be discovered dynamically, since their IP addresses will change. Prometheus can be configured to use the Kubernetes API to discover changes in the list of running instances dynamically. The following shows a minimalistic Prometheus example of instrumenting an application with multiple pod instances. Prometheus ...

Read More »

Spring Setter Dependency Injection Example

spring-interview-questions-answers

Learn how to write Spring Setter Dependency Injection Example. The Setter Injection is a type of Spring Dependency Injection. Spring supports Field Injection, Setter Injection as well as Constructor injection to inject dependencies in a Spring managed bean. Scope of this tutorial is limited to Setter Injections. More on Spring Dependency Injection: Spring Constructor Dependency Injection ExampleSpring Field Dependency Injection ExampleSpring ...

Read More »

Spring Dependency Injection and Inversion of Control

spring-interview-questions-answers

Learn the concepts of Dependency Injection and Inversion of Control and then look into how the Spring Framework supports them with the help of code examples. Inversion Of Control Before we start off with anything, let’s learn what the Inversion of Control is. The Inversion of control is a term used in Object Oriented Programming, by which the control of an object ...

Read More »

Spring Framework Architecture

spring-interview-questions-answers

This is an overview of Spring Framework Architecture. Learn how the various components of Spring Framework are organised and relates to each other. If you want to know what is Spring framework and its features please read Introduction to Spring Framework. Overview Spring is a modular framework. It doesn’t come as a package or bundle of multiple modules. Various spring ...

Read More »

Introduction to Spring Framework

spring-interview-questions-answers

This is an Introduction to Spring Framework and Spring’s core concepts. In this tutorial, we will cover the main advantages, and features of Spring Framework. In the subsequent tutorials we will learn more about Spring and Spring Boot. Overview We know, Spring Framework is the most popular Application Frameworks in the world of Java developers. Spring is well known for providing abstractions and an infrastructural ...

Read More »

Pagination and Sorting with Spring Data JPA

java-interview-questions-answers

Learn Pagination and Sorting with Spring Data JPA with code examples. Understand how to get Paginated and Sorted results using Springs PagingAndSortingRepository interface. 1 Overview While dealing with large amount of data the lazy processing is often essential. Even if a service returns a huge amount of data the consumer is less likely using it. Consider a shopping website, where ...

Read More »

Difference between @ContextConfiguration and @SpringApplicationConfiguration in Spring Boot Integration Test

spring-interview-questions-answers

Even though both @ContextConfiguration and @SpringApplicationConfiguration annotations are used along withSpringJUnit4ClassRunner to specify how to load the Spring application context, there is a subtle difference between them. Although @ContextConfiguration does a great job in loading application context it doesn’t take full advantage of Spring Boot features. Spring Boot applications are ultimately loaded by either SpringApplication ( in case of the ...

Read More »