[ 
https://issues.apache.org/jira/browse/BVAL-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257068#comment-17257068
 ] 

Gerhard Petracek commented on BVAL-184:
---------------------------------------

@romain:

actually it's already used exactly in a jax-rs based application (at least in 
combination with weld it works – also the part you objected).

what you showed/mentioned back then was based on the initial poc-draft. with 
the latest additions it worked.

once i have time for it, i can create additional use-case demos with tests (to 
verify every use-case in question with owb as well as weld).

however, if something doesn't work, we can have a look at the details (there 
are so many cases which work already – and with a bit more time it shouldn't be 
that hard to document the cases which are supported due to the spi).

 

@perf.:

also if you have e.g. 1-2 active resolver/s, the overhead for non-proxied 
instances is just 1 instanceof check (per resolver).

and in case it is a proxy-instance the rest is almost the same overhead (as 
with constraints on the getter-methods).

i have to update my benchmark, but back then the impact isn't that significant 
(esp. compared to constructor validation,...).

(whereas the overhead of the refactoring to streams in bval2 showed a quite 
significant impact btw. ...)

 

@"bval interceptor the programmatic validation":

"until it is nested" ... that's the point (it was never about the root-bean – 
in that case my addon based on the bval-api would have been enough)

 

@"set it programmatically":

you need to configure the impl. (of your choice) via spi-config anyway. only if 
there would be a resolver-lib which packages the spi-config out-of-the-box 
would lead to an autom. activation. however, if that part is your main concern 
(that users just add libs with packaged spi-configs without knowing it), then 
we can think about an explicit (prog.) activation.

 

> Support for proxied instances
> -----------------------------
>
>                 Key: BVAL-184
>                 URL: https://issues.apache.org/jira/browse/BVAL-184
>             Project: BVal
>          Issue Type: New Feature
>            Reporter: Gerhard Petracek
>            Assignee: Gerhard Petracek
>            Priority: Major
>
> currently org.apache.bval.jsr.util.Proxies just detects the real class, but 
> that means only getters can get annotated.
> with a spi like
> {code}
> public interface InstanceResolver extends Comparable<InstanceResolver> {
>     <T> T resolveInstance(T instance);
>     //...
> }
> {code}
> it would be possible to create resolvers for external libs (like owb, weld, 
> ...)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to