[Nepomuk] Query API - method return types
Sebastian Trüg
sebastian at trueg.de
Mon Mar 12 10:31:56 UTC 2012
I agree. :)
On 03/10/2012 11:01 AM, Ivan Čukić wrote:
> Hi,
>
> A RFC regarding the query API for Nepomuk in KF5.
>
> Proposal:
>
> Methods that modify a Term and currently return void should return a
> reference to (*this) that is Term &.
>
> Reasoning:
>
> Database query languages are functional in nature, so should be the
> query building apis like this one.
>
> By defining the method return type as void, we need to define separate
> variables if we want to change some term before inclusion into the
> main term (non-functional approach):
>
> ComparisonTerm related = ComparisonTerm(something, something);
> related.setInverted(true);
> ResourceTypeTerm(NFO::FileDataObject()) && related;
>
> Instead of being able to write it as:
>
> ResourceTypeTerm(NFO::FileDataObject()) &&
> ComparisonTerm(something, something).setInverted(true)
>
> I'm in a hurry, so this is not really worded properly, but you'll get
> the gist I think :)
>
>
More information about the Nepomuk
mailing list