[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[p2-dev] Query Management Proposal
I have updated the query management proposal by adding bug numbers and a better description of the problem  (Query and Query Results are too tightly coupled). When complete, this will allow anyone implementing IQueryable to:
1. Build custom query mechanisms
2. Return results in different ways (lazy / incremental for example)
This is not just for those building DB backed repositories, as I could imagine even the default p2 repos taking advantage of these things (for example, we could store the IUs ordered by version number, then create a custom query for getLatestIU that uses this fact).
While the proposal has a lot in it, what has been more daunting for me is how I can do this in a manageable way. Nobody (especially not me) wants a single patch that tries to cover everything. To address this proposal, I propose tackling the issues as follows:
1. Design support for Compsite Queries: This includes both making Collectors queryable  and support "CompoundQueries" 
2. Rewrite complex collectors as queries. I have started on this with LatestIUVersionElementQuery . I will work towards other as the week goes on.
3. Once the complex collectors have been removed, we can eliminate the need for the collector to be passed to the query 
4. Also, once the complex collectors have been written in terms of Queries, we can identify Queries which are "Transparent". These queries will have "known" semantics and access to their fields so others can provide custom implementations .
5. Finally, we can re-design the Collector interface to support incremental loading of results, status, etc... Since clients will be free to implement their own Collector (See point 3), this will likely be an exercise in design more than anything else. I will likely need a hand here (hopefully from Jeff, Scott, Susan, Tomas and Hendrik). (Of course, everyone else is also welcome :) )