[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Match/Context naming

On 02/24/2010 05:10 PM, Susan Franklin McCourt wrote:

One of the queries can be determined in isolation from the other candidates.


Check. A boolean outcome is evaluated for each candidate.

The other query can only be determined relative to all of the other candidates.

While you need all candidates in order to deliver a result, there is nothing saying that one candidate is compared to other candidates. It might be the case (as in the case of latest()), but far from always.

Both queries are computed by running some expression and getting a boolean back that determines if there is match. (In my brain, boolean and match are the same).

No, that's not correct. This query has no boolean expression involved:

collect(iu | iu.requiredCapabilities).flatten()

It simply iterates over all candiates, obtains their requiredCapabilities and then flatten all resulting collections into one collection that is returned.

The differentiating point is whether the other candidates need to be examined to determine the answer.

I think I see where the confusion lies. You think that there is always some boolean function that determines whether or not a candidate should be included in the result. In one case, that function needs the other candidates to determine the result and in another case it can be determined in isolation. That distinction is no longer strictly valid. For two reasons:

1. As shown in the example above, there need not be any boolean expression invovled.
2. If there is a boolean expression, it might act on one candidate at a time in isolation from other candidates.


For case #2 consider the following:

 select(x | x.id == 'some.name')

Written like that, it needs access to all candidates. Still, it peruses one candidate at a time. The query can also be written as the 'match' query

 x.id == 'some.name'

So what is the difference between the two? That's the essence of what I want to clarify.

- thomas