using primary and foreign keys as class properties
using primary and foreign keys as class properties
- Subject: using primary and foreign keys as class properties
- From: Steven Mark McCraw <email@hidden>
- Date: Sat, 3 Feb 2007 18:36:51 -0500
Hi everyone,
I recall reading in some of the early Apple WebObjects documentation
that it's a huge terrible thing to mark your foreign and primary keys
as class properties (e.g. check the little diamond in EOModeler so
that your generated classes give you setters and getters to access
them directly). Over the years, I've often thought it would be
convenient to have the keys as class properties, particularly when
I've had to write custom queries. I know EOUtilities gives you
methods to get the primary and foreign keys for an object, but using
these are kind of a pain compared to just calling a simple accessor
method.
I've actually set keys as class properties a few times, but whenever
a strange EOF exception cropped up, this was the first thing I always
changed back (in a rather superstitious, paranoid way) for fear that
somehow having the keys as class properties was giving EOF a fit. I
started thinking about it again the other day for some reason, and
frankly I can't think of any reason it should have an effect on EOF,
so I thought I would pose the question to the list.
Is having keys as class properties just something that is for some
reason considered "bad form" by the early documentation writers at
Apple (I recall the same documentation firmly asserting that you
never need to do anything outside EOF, but in the real world this
isn't always practical when you need to optimize)? Or is there in
fact something about having keys as class properties that throws a
monkey wrench into EOF at unpredictable times?
Thanks in advance for help/discussion.
Mark
_______________________________________________
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