• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer
  • Home
  • Java Tutorial
  • Java Posts
  • Node.js
  • Spring Core
  • Algorithms
  • Docker
  • Blogging
  • Misc
Tech Stack Journal

Tech Stack Journal

Admin

Java based Spring Configuration

August 30, 2020 by Admin Leave a Comment

In the previous articles, we saw how to configure the beans based on XML and annotations. In this example, we'll learn how we can configure beans based Java configuration, a third approach to configure Spring beans. We'll follow the similar class design by coding to interfaces. Class Structure Item - a POJO class to store item infoItemDAO - an interface that we will use … [Read more...] about Java based Spring Configuration

Autowire Spring Beans using XML Configuration

August 29, 2020 by Admin Leave a Comment

Let's look at the examples to Autowire the Spring beans by constructor, by type and by their names using Spring XML configuration. Class Structure Product - a POJO class to store product infoProductDAO - an interface that we will use in a dependent service classProductDAOImpl - an implementation of ProductDAO returns list of mocked Product instancesProductService - an … [Read more...] about Autowire Spring Beans using XML Configuration

Annotation Based Spring Config and Auto Wiring

August 27, 2020 by Admin Leave a Comment

In this example, I'll show how to do an Annotation Based Spring configuration to define beans and auto wire them together. Use Case The Use Case we are going to work on is to fetch list of employees from a service. The service inturn fetch it from data access object. Creating a Maven Project First create a simple Maven project by skipping archtype selection in … [Read more...] about Annotation Based Spring Config and Auto Wiring

Spring XML Configuration and Setter Injection

August 25, 2020 by Admin Leave a Comment

In this example, we will inject the dependencies of a class using setter injection. For setter injection, if class A refers to another class called as B, then A should expose a setter method with B as its argument. Use Case The use case that we implement is like the one we did using constructor injection. We write a mock UserDAO class to retrieve User list. UserService … [Read more...] about Spring XML Configuration and Setter Injection

Spring XML Configuration and Constructor Injection

August 24, 2020 by Admin Leave a Comment

This is an example to show you how we can inject dependencies using constructor injection within Spring XML configuration. Use Case Our use case is simple, we want to establish the dependencies between app, service and data access layers. We want to retrieve list of users from database (mocked in our case) using a data access object. Service refers to the data access … [Read more...] about Spring XML Configuration and Constructor Injection

« Custom Previous Page Link
Next Page »

Primary Sidebar

More to See

Arrays.asList in Java Examples

February 21, 2021 By Admin

[Solved] Why List.add throws UnsupportedOperationException in Java?

February 20, 2021 By Admin

Secondary Sidebar

Categories

  • Algorithms
  • Blogging
  • Docker
  • Java
  • Misc
  • Node.js
  • Spring Core
  • Windows

Archives

  • February 2021 (6)
  • January 2021 (1)
  • December 2020 (1)
  • September 2020 (2)
  • August 2020 (5)
  • July 2020 (4)
  • June 2020 (1)
  • May 2020 (4)
  • April 2020 (22)
  • November 2019 (3)
  • September 2019 (2)
  • August 2019 (6)

Footer

Navigation

  • Home
  • Java Tutorial
  • Java Posts
  • Node.js
  • Spring Core
  • Algorithms
  • Docker
  • Blogging
  • Misc

Recent

  • How to Make File Explorer Open to This PC instead of Quick Access in Windows 10
  • Arrays.asList in Java Examples
  • [Solved] Why List.add throws UnsupportedOperationException in Java?
  • How to Convert an Array to List in Java?
  • How Many Spaces in a Tab?

Search

Copyright © 2021 · Tech Stack Journal · Log in