[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] QueryUtil change
- From: Thomas Hallgren <thomas@xxxxxxx>
- Date: Fri, 26 Feb 2010 23:17:40 +0100
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:220.127.116.11) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b1 Thunderbird/3.0.1
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,
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.
At a glance this looks rather gratuitous.
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.