Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: More Readable EOQualifiers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More Readable EOQualifiers



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

References: 
 >More Readable EOQualifiers (From: David Avendasora <email@hidden>)
 >Re: More Readable EOQualifiers (From: Chuck Hill <email@hidden>)
 >Re: More Readable EOQualifiers (From: David Avendasora <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.