[prev in list] [next in list] [prev in thread] [next in thread]
List: nepomuk
Subject: Re: [Nepomuk] Query API - method return types
From: Sebastian Trüg <sebastian () trueg ! de>
Date: 2012-03-12 10:31:56
Message-ID: 4F5DD09C.3040401 () trueg ! de
[Download RAW message or body]
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 :)
>
>
_______________________________________________
Nepomuk mailing list
Nepomuk@kde.org
https://mail.kde.org/mailman/listinfo/nepomuk
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic