Re: Generating EO Java Files in xcode 2.1
Re: Generating EO Java Files in xcode 2.1
- Subject: Re: Generating EO Java Files in xcode 2.1
- From: Art Isbell <email@hidden>
- Date: Mon, 20 Jun 2005 17:23:05 -1000
On Jun 20, 2005, at 5:08 PM, Bruce Fancher wrote:
I think static typing is one of the most
overrated features in the history of programming, but I guess you
can always
make the case that it's useful letting the compiler catch things like
setNmae(...), whereas takeValueForKey("Bob", "nmae") wouldn't be
caught
until runtime.
But you can have your cake and eat it, too. Instead of using
literal strings as key-value coding keys, in your EO class (e.g.,
Foo), define string constants for each key:
public static final String NamePropertyName = "name";
Then use these string constants in your key-value coding methods:
object.takeValueForKey("Bob", Foo.NamePropertyName);
If you enhance the EOGenerator template to define these string
constants automatically, runtime errors due to typos should not occur.
Aloha,
Art
_______________________________________________
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