'Is it a good idea to create commands as Spring bean in the CQRS design pattern in Spring Boot?

I've always used CQRS design pattern in Spring where Commands are simple POJOs and not Spring Beans (annotated with @Component). However, I recently started to wonder what would happen if those commands are treated as beans. I do not have a good feeling creating commands as beans but it's always a good idea ot have a second opinion on it for educative purposes.

Kind regards.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source