Re: Queries
Re: Queries
- Subject: Re: Queries
- From: Chuck Hill <email@hidden>
- Date: Tue, 27 Jan 2004 09:49:35 -0800
Hi James,
EOQualifier is usually used with EOFetchSpecification. Whether you create
them in code or the EOModel is largely a matter of preference. There are
certain things that can be done in code that are not possible to model. I
think, I rarely put them in the EOModel out of preference.
You can also use them to filter in-memory arrays of objects, such as a
to-many relationship. Doing so *can* avoid another trip to the database.
Or, if the objects are not in memory and your are not batch faulting, can
result in many, many trips to the database. If the number of objects in the
to many is great and the number matching the qualifier is small it can be
faster to go to the DB. It can also be faster to do this in memory if the
objects have already been fetched and there are no indexes on the DB to
optimize the query. Its complex.
You will be better off focusing on an object design that is easy to
understand and easy to maintain and worry about optimization when (or, more
likely, if) you need to.
Chuck
At 10:44 AM 27/01/2004 -0600, james cicenia wrote:
>Ok -
>
>I have been perusing the voluminous documentation and apis and I came
>across EOQualifier. I was wondering if I should use this method to
>create
>my many subsets of data after pulling my objects via the one to many
>relationship. Originally, I was modeling all of this with EOModelers
>Fetch
>Specifications but that would always go to the database first.
>
>Would it be cleaner and more efficient to code all my sub-selects as
>methods
>in the base classes that EOModeler creates for me using EOQualifier?
>
>For instance my portfolio object will have many projects with different
>status, etc. and these would be displayed in their own particular pane
>on the web page.
>
>Just fishing for good design patterns here.
>
>Sincerely,
>
>James Cicenia - President/CEO
>cell: 773.398.4649
>www.jimijon.com
>~~~~~~
>The Internet's only Weekly Video Horoscope!
>http://absinthium.jimijon.com
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Queries (From: james cicenia <email@hidden>) |