I'm working at a new company. Got to fix a bug. I didn't understand the code and therefore asked people you have been working there for years on the product. It had to do with java spring framework annotations. Three of them said something along the lines "this is spring magic", " that's complicated, it confuses me, too", or "I don't understand the code either", basically they couldn't explain it to me. Are they just not knowledge able or is the spring framework really that complicated?
Java spring is just creating objects in container and u can ask object from container whenever u need it. That's it
It would be helpful to understand why something like that is useful in a project, though.
Yes agree that theory is painful, but helpful
It's not magic. It's at times too much to remember -- what annotation if I may ask? I work on Spring too
It's about @RequestMapping: @RequestMapping(params = FOO_PARAMS, method = RequestMethod.POST) public Bar foo(...) More context: Some functions are called, eventhough it is not defined their controller. I got a page and a modal window. In both I got a submit method. In the page, the form submit method it is referenced to the foo() function. But in the modal window it is not. How ever. When I hit the submit button in the modal window, the foo() function is executed as well. It's like whenever a post request is sent, this function is called - even though it's not referenced in the Controller.
Maybe it's because both submit buttons are on the same webpage? How can I prevent the foo() function to be executed if I hit the submit button in the modal window?
Ignore everyone above saying “it’s just....” I’ve been working with spring for 5 years now and I’m still constantly looking up how to do certain things. There are so many spring projects too. For example, you use spring framework and spring boot and add in spring rabbitMq. Ok cool, you think you understand rabbit configuration. Now you add spring integration. Everything changes for the configuration to connect to rabbit. Ok you learn the differences. Then company says let’s add spring stream just in case we want to switch to Kafka. Everything with rabbit changes again. It has a steep learning curve especially when you start considering all the other projects. And it’s grown to be much much more than just simply dependency injection inversion of control.
I agree. Same can be said about any framework. But if you don’t know anything about it like the OP was suggesting then first learn the basics before you dive deep on rabbitmq integration
It has a deep learning curve, people who tell you it's magic is not trying to understand it. If you take time to dig deeper, you will be the most knowledgable person on the team. And jump after that since you don't want to work with people who you don't learn much from.
The initial week or two are hard because it’s a huge framework with a lot of moving pieces. It can also be easily fucked up by people who have no idea what they’re doing. Spring ancient vs spring boot also differ in a lot of aspects. I’d recommend learning spring first on a vanilla personal project before trying to tackle whatever your codebase may have. It’s hard to unlearn bad stuff , and based on the responses of your colleagues, there’s a lot of bad stuff
You just have to understand the basics: dependency injection and inversion of control
This