Re: More Readable EOQualifiers
Re: More Readable EOQualifiers
- Subject: Re: More Readable EOQualifiers
- From: John Huss <email@hidden>
- Date: Fri, 13 May 2011 13:49:31 -0500
On Fri, May 13, 2011 at 1:38 PM, David Avendasora
<email@hidden> wrote:
My new strategy combines still doing some setup, but the setup is explicitly for making things easier to read.
EOQualifier haveRedHair = Student.HAIR_COLOR.eq(MyAppConstants.RED_HAIR);
EOQualifier areActive = Student.IS_ACTIVE.isTrue();
NSArray redheadedStudents = mySchool().students(Student.that(haveRedHair).and(areActive));
The thing is, the code only reads like english IF you save the qualifier to a temporary variable AND name it appropriately; that's too loose of a constraint. So I would agree with Ramsey that the shorter, non-english version is sufficient. I'm not opposed to adding it, but I probably wouldn't use it.
As for generating them in the templates I don't think it's worth it. I would take less time to declare a constant with the qualifier than to add it to the model somehow.
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden