Timeline for Using Spring Boot's @ConfigurationProperties without violating Law of Demeter
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 12, 2019 at 15:47 | vote | accept | James | ||
Mar 7, 2019 at 5:31 | comment | added | casablanca |
Note that anything you can do with @Service , you can also do externally via a configuration class. The service annotation might be a tad bit simpler but the trade-off is that you couple your classes to Spring.
|
|
Mar 6, 2019 at 15:56 | comment | added | James |
Thanks. This post and the Spring reference doc indicate that other benefits of using @Service is clearly marking the intent of the class, ease of targeting pointcuts, possible tool integration and that @Service may carry additional semantics in future releases. So, I suppose it's a trade-off between those benefits vs not violating the Law of Demeter.
|
|
Mar 6, 2019 at 7:19 | comment | added | casablanca |
Yes, @Service and other component annotations are just markers for component scanning (Spring javadoc).
|
|
Mar 5, 2019 at 18:58 | comment | added | James | Thanks, but what impact do we have by losing @Service annotation on OrderService? Is it only component scanning? | |
Jan 27, 2019 at 2:00 | history | answered | casablanca | CC BY-SA 4.0 |