Sunday, February 9, 2020

Tackling Spring

Spring is undoubtedly a powerful framework. But as I started to use it I was confused by its "magic". The complexity hidden from the user/developer. Hiding complexity may seem like a useful thing first but it will definitely bite you later. IMHO frameworks do not save you from the complexity. In order to use a framework productively you have to understand what it does under the hood.
What makes a good framework in my opinion is consistency. Some kind of pattern that runs through the framework. Something that makes it a lot easier and more convenient to deal with the framework once you understood it.
And I'm still struggling to find this pattern for spring. Maybe because spring is just huge. What I've learned so far is that spring is at its core a dependency injection framework. You can define stuff with annotations like @Component @Service or @Bean. Based on the type (or qualifiers) these dependencies (beans) are injected via the constructor or into fields marked with @Autowired.
Seems simple enough but what makes it more complex imho are "hidden" bean declaration declared by the use of other annotations.
Let's see where this quest will lead me to. Spring integrations are the next thing I'm going to learn.