---
title: "Comment by Shai Almog on \"Spring Basics - Dependency Injection\" | Hashnode"
description: "Why XML and not annotations?"
url: "https://hashnode.com/posts/spring-basics-dependency-injection/61f98ee2e0502911a6f10cd5/comment/61fa0eb443e34d1181695e29"
---

[Discussion](https://hashnode.com/posts/spring-basics-dependency-injection/61f98ee2e0502911a6f10cd5)

Comment [Spring Basics - Dependency Injection](https://hashnode.com/posts/spring-basics-dependency-injection/61f98ee2e0502911a6f10cd5)

[Shai Almog](https://hashnode.com/@talktotheduck)

[Feb 2, 2022](https://hashnode.com/posts/spring-basics-dependency-injection/61f98ee2e0502911a6f10cd5/comment/61fa0eb443e34d1181695e29)

Why XML and not annotations?

[Max DeMaio](https://hashnode.com/@maxdemaio)

[Feb 2, 2022](https://hashnode.com/posts/spring-basics-dependency-injection/61f98ee2e0502911a6f10cd5/comment/61fa0eb443e34d1181695e29#reply-61fa1084e0502911a6f11609)

Hi there! I chose XML configuration solely for small tutorial purposes. I'm able to explicitly show constructor/setter injection. It gives a good visual on how Spring configures metadata into its managed objects.

But, in future Spring posts I'll be ditching XML for annotation-based configs :D
