3 ms·
But then despite that the class is getting a generated proxy that does basically nothing or is causing the problem and it is really hard to determine anything e
by PaulKeeble 6y ago
But then despite that the class is getting a generated proxy that does basically nothing or is causing the problem and it is really hard to determine anything except tracing it at runtime to find out what actually is being run. People do some crazy things with Spring and interface injections in Java and it can get really Opaque quickly but also often it really is just 1 class implementing an interface and there are no tests using the interface at all.
- tonyarkles 6y agoFor the one project I worked on that was Spring-based, my joke was that Spring was a really effective way to convert compile-time errors into run-time errors :)
- Pet_Ant 6y ago> Spring was a really effective way to convert compile-time errors into run-time errors :) This is not a joke. Spring invalidates refactoring tools and a lot of static analysis. It makes working on Java feel like you are working on Python or something. The traceability of errors is very low. You can limit yourself to a subset of Spring's functionality (eg no component scanning, wiring up the beans manually) but it will not be idiomatic.
- arcbyte 6y agoAnd now you're into the Liskov substitution principle. All of your implementations should honor the same contract even if they do it in different ways.
- eweise 6y agoNo need to create interfaces generally in spring when there will only be one class implementing. For testing, mocks can be created directly from the actual classes.