Evaluable criteria

Marvin Addison marvin.addison at gmail.com
Tue Jun 2 09:15:18 EDT 2015


>
> The problem I quickly ran into is:  With Java generics you can only
> implement that interface once.  You can't implement the interface multiple
> times in a given class, merely by changing the generically parametrized
> type.  So you can't have say a single EntityIdCriterion class that
> matches(EntityDescriptor), matches(RoleDescriptor), matches(Credential),
> etc.
>

Offhand, it seems there's an easy solution: make three different Criterion
classes, one for each type, then give CriteriaSet intelligence to do
any/all/other combinations for multiple matches. I guess I'm making an
academic argument at this point since I clearly haven't spent as much time
as you have, so I'll just trust that the current design is best for the
given cases.

This is important b/c sometime criteria are created by a caller that
> doesn't know what it's going to be evaluated against
>

That seems odd to me. What's the point of caller having control over
criteria if he/she doesn't know what types are in play for criteria
evaluation?

M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20150602/187b8af7/attachment.html>


More information about the dev mailing list