• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Generating EO Java Files in xcode 2.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >RE: Generating EO Java Files in xcode 2.1 (From: "Bruce Fancher" <email@hidden>)

  • Prev by Date: RE: Generating EO Java Files in xcode 2.1
  • Next by Date: Re: newbie needs help/advice
  • Previous by thread: RE: Generating EO Java Files in xcode 2.1
  • Next by thread: How to handle trigger from database.
  • Index(es):
    • Date
    • Thread