With ch02-xml, let us demonstrate how Spring loads objects using the XML-based ApplicationContext container:
- Create a package org.packt.starter.ioc.model, where our model classes will be placed. Our model classes will be typical Plain Old Java Objects (POJO), for which the Spring 5.0 architecture is known.
- Inside the newly created package, create the classes Employee and Department, which contain the following blueprints:
public class Employee { private String firstName; private String lastName; private Date birthdate; private Integer age; private Double salary; private String position; private Department dept; public Employee(){ System.out.println(" an employee is created."); } public Employee(String firstName, String lastName, ...