[hibernate-dev] [HV] Making dependency to Unified EL optional or not?
Gunnar Morling
gunnar at hibernate.org
Tue Apr 23 13:11:32 EDT 2013
Hi all,
Hardy and I are heads-down in a discussion [1] about an HV issue [2] and
would like to get some input from others.
Background: BV 1.1/HV 5 allow to use Unified EL in constraint violation
messages which enables dynamic messages, advanced formatting options etc.
Problem: The scope of the EL dependencies (API and impl) in HV is
"provided", since they are typically contributed by the container under
Java EE and thus HV shouldn't pull them in transitively. For Java SE this
means though that the user has to explicitly provide these dependencies
which is easy to forget.
Proposed solution: HV-784 is about making this step on SE only then
required if EL actually is used in error messages. If EL is not used, the
user wouldn't have to add the dependencies. EL is required when the user
* works with ${...} expressions in his constraint messages
* applies the built-in @DecimalMax/Min constraints which use EL in their
default messages as of HV 5
Pro's:
* EL dependencies only required if EL is actually used (fewer dependencies,
smaller application)
* Update from HV 4 to 5 works for more users out of the box (simple version
update instead of adding two more dependencies which are potentially not
used)
Con's:
* More complex implementation (requires reflective check whether EL types
are present)
* More complex rules for the user for setting up the class path
What do you other folks think, should the suggested feature be implemented
or not? We're looking forward to your opinion, also feel free to join the
discussion on the PR.
Thanks,
--Gunnar
[1] https://github.com/hibernate/hibernate-validator/pull/241
[2] https://hibernate.atlassian.net/browse/HV-784
More information about the hibernate-dev
mailing list