[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] Match/Context naming
- From: Thomas Hallgren <thomas@xxxxxxx>
- Date: Wed, 24 Feb 2010 17:53:01 +0100
- Delivered-to: firstname.lastname@example.org
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:126.96.36.199) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b1 Thunderbird/3.0.1
On 02/24/2010 05:10 PM, Susan Franklin McCourt wrote:
One of the queries can be determined in isolation from the other
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
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.