Contribute to help us improve!

Are there edge cases or problems that we didn't consider? Is there a technical pitfall that we should add? Did we miss a comma in a sentence?

If you have any input for us, we would love to hear from you and appreciate every contribution. Our goal is to learn from projects for projects such that nobody has to reinvent the wheel.

Let's collect our experiences together to make room to explore the novel!

To contribute click on Contribute to this page on the toolbar.

Dependency Injection

A good starting point for understanding DI is https://en.wikipedia.org/wiki/Dependency_injection.

  • Spring

  • Quarkus

In spring the reference documentation explains the dependency injection (DI) aka Inversion of Control (IoC) mechanisms in deep details: https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-introduction

For quarkus the following article explains the details of dependency injection: https://quarkus.io/guides/cdi-reference

Use annotations over xml for controlling DI

Some frameworks like spring might still allow Bean definitions via XML. This should be avoided and instead the annotations should be used.

Use constructor injection

Constructor injection makes the code better testable, because dependencies can be mocked without using reflection techniques.

Spring specific rules

Omit @Autowired annotation on constructor injection

Starting with spring 4.3 @Autowired is not necessary anymore on constructor injection. If the used version is higher or equal 4.3, then the annotation should be omitted.