This is a Java console-based application that demonstrates Dependency Injection using XML configuration in Spring Framework.
It simulates a library system with:
- A list of books
- Each book has an author, publisher, and categories
- A map of authors by their countries
- Java 8+
- Spring Framework (Core Container)
- XML-based Bean Configuration
- Maven (optional for structure)
- IntelliJ IDEA
- Dependency Injection via XML
- Nested Beans
- Collections Injection:
List
of books and categoriesMap
of authors by country
- Bean Reuse via
ref
andvalue-ref
- Clone the repository or download the project files.
- Open in your favorite IDE (IntelliJ / Eclipse).
- Make sure Spring libraries are added to your classpath.
- Run the
Main.java
class. - You should see the output printed in the console showing books, authors, publishers, and mapped authors by country.