Re: Caching reference data
Re: Caching reference data
- Subject: Re: Caching reference data
- From: Chuck Hill <email@hidden>
- Date: Mon, 18 Oct 2004 10:25:21 -0700
Here is what I would look at doing. The core ideas being that
reference types are reference types and not audit trails, audit trails
can, and often should, be kept as separate objects. This also assumes
that you need the reference data frequently and the audit trail
infrequently.
1. Use inheritance so that all the reference types have a common
superclass between them and EOGenericRecord (or whatever). This is
usually a good idea anyway as you can avoid a lot of repetitive coding.
2. Add an audit object for this reference data. This object will have
a unique id (aka primary key if you are so inclined), a relation to a
reference object, a relation to the adding user, and a relation to the
last updating user. Add some dates if you need them.
3. Add a method in the reference object super class to fetch the
appropriate audit object (fetch audit where reference object = this).
Call this when you need the audit info. This avoids references out of
the shared EC.
4. Add code to create the audit object when a reference object is
created.
5. When a reference object is modified, get the audit object and also
update it. When you save both the reference object and the audit
object get saved.
Make sense?
Chuck
On Oct 17, 2004, at 9:57 AM, Jason McInnes wrote:
The problem now is that I was fetching these reference
types into the shared editing context like a good boy,
but like a bad boy, they have relationships to
non-shared entities (i.e., the users). So when I
create an object, log out, and log back in I get a
shared entity context violation error.
I want the benefit of caching these reference types
without the overhead of having to do the
localInstanceOfObject step storing them in arrays on
my Application object, and I'd like to not have to
change my model (e.g., storing just the user name on
reference types rather than a relationship to user).
Am I out of luck?
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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