On 2010-11-22 13.39, Niclas Hedhman wrote:
Question;
ServiceQualifier has a DSL-like construct, but
a. is that ever used??
b. AFAICT, it will also fail;
ref = first( withTags( "SuperService" ).whereAvailable(), services );
You can't actually do the above, so... I think what I really want to do
is remove ServiceQualifer, and instead use
Specification<ServiceReference>. Because then you can create boolean
expressions using the helpers in Specifications and Iterables:
ref =
Iterables.first(Specifications.and(ServiceQualifier.withTags("SuperService"),
ServiceQualifier.whereAvailable()), services);
which after static imports become:
ref = first(and(withTags("SuperService"), whereAvailable()), services);
And isn't it reasonable to move the DSL style outside of Qi4j Core,
and allow community evolution of DSL expressions? IIUIC, Qi4j Core
only needs an interface with the qualifies() method...
Yes, see above. The past weekend I added Iterables and Specifications to
Qi4j Core API, so it's just a matter of letting ServiceQualifier use
that, and then it becomes more easily used and extensible. I can make
that switchover any time really.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev