spring
spring copied to clipboard
Spring auto-configuration features
@heruan commented on Thu Dec 07 2017
When building many apps with Flow, I want to be able to create modules with shared/configurable routes and override them if needed, so that I do not have to duplicate code or write classes for the sole purpose to annotate them with @Route
.
Use case:
@Route("${acme.login-route:login}")
@ConditionalOnMissingRoute
public class LoginComponent extends VerticalLayout { /* ... */ }
This could be in a module shared by many apps, each of one can override the default route in its own configuration file or override it completely with a new component if annotated with the same path.
@Legioth commented on Thu Dec 07 2017
Seems like there are two low level features at play here:
- Support
${<expression>}
in@Route
values, specific to our Spring add-on -
@ConditionalOnMissingRoute
as a generic Flow feature to opt out from conflicts if there are multiple routes for the same location.
@heruan commented on Thu Dec 07 2017
Indeed. At first I considered @ConditionalOnMissingRoute
as part of the add-on too, since @ConditionalOn[...]
is a common convention in Spring Starters. But having it native in Flow could be useful for non-Spring developers too.
@Legioth commented on Thu Dec 07 2017
The functionality is indeed generically useful, but on the other hand the @ConditionalOn
naming is quite specific to Spring.
@heruan commented on Wed Jan 03 2018
Another useful feature for Spring configuration (e.g. via properties
/yml
files) could be enabling push (and async servlet support).