This repository demonstrates on POJO & Java Beans and different ways to configure and manage beans in Spring applications.
- Path: example-1-pojo-and-java-beans
- Purpose: Demonstrates the difference between Plain Old Java Objects (POJOs) and JavaBeans.
- Path: example-2-spring-beans-xml
- Purpose: Explores how to define and configure Spring beans using XML configuration files.
- Key Features:
- Defining beans in demo.xml.
- Dependency injection using
<property />
and<constructor-arg />
. - Demonstrates the traditional way of configuring Spring applications.
- Learning Objective: Learn how to use XML for bean configuration and dependency injection in Spring.
- Path: example-3-spring-beans-java-and-annotation-configuration
- Purpose: Showcases modern Spring bean configuration using Java-based Configuration and Annotation-based Configuration.
- Key Features:
- Bean definitions with
@Bean
in configuration classes. - Use of annotations such as
@Component
,@Service
, and constructor and setters for dependency injection. - Demonstrates the primary approach in modern Spring applications.
- Bean definitions with
- Learning Objective: Understand how to configure Spring beans using Java-based and Annotation-based Configuration.