Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] QueryUtil change

On 02/26/2010 08:15 PM, Pascal Rapicault wrote:
Thomas, could you please explain the rationale behind the move to merge all the queries we had into one big QueryUtil class?
It's far from all queries. Only the ones from the metadata package. There are still many special query classes in other packages like director, repository.artifact, engine, touchpoint.eclipse, and ui,

  At a glance this looks rather gratuitous.

The reason was to hide the actual implementation of the queries. Now all factor methods return an IQuery<T> and all are instances ExpressionQuery or ExpressionMatchQuery. There was little need to have special classes just to define the actual string for the expression.

The QueryUtil class could of course be split into several classes with a more specific purpose but I'm not sure I see any gain in doing that. Having the factory methods in one class gives you a good overview of what queries that are available. Far easier then looking at the type hierarchy extending from IQuery and then look at each class in turn.

- thomas



Back to the top