• 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: Semantics of ^ in value bindings in .wod file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Semantics of ^ in value bindings in .wod file.


  • Subject: Re: Semantics of ^ in value bindings in .wod file.
  • From: Anjo Krank <email@hidden>
  • Date: Sat, 29 Dec 2007 20:14:49 +0100


Am 29.12.2007 um 18:57 schrieb Archibal Singleton:

^foo in the wod is the same as parent().valueForBinding("foo") in java
parent.foo in the wod is the same as parent.valueForKey("foo") in java


The first line requires a parent with foo bound. The second line requires a variable or method named foo.

Thanks for the clarification Uli, the nuance is indeed important and I didn't get it at first.

It's important and unfortunately is not quite right. Assume your parent java has:


public String hello() {return "Hello"}

The parent wod has

MySub : MySub {
   foo = hello;
}

The child MySub has:

MyFoo : WOString {
  value = ^foo;
}

Then you get whatever your parent has bound against the child instance's "foo" binding. This is NOT the same as parent().valueForBinding("foo"), which would get what the parent of the parent of MySub had bound to "foo".

It mainly a shortcut so you don't have to write in the child java:

public Object foo() {return valueForBinding("foo")}

and in the child wod:

MyFoo : WOString {
  value = foo;
}

I'm normally not picky about stuff, but this IS an important concept and in particular valueForKey() and valueForBinding() can be hard to tell apart...

Cheers, Anjo
_______________________________________________
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


  • Follow-Ups:
    • Re: Semantics of ^ in value bindings in .wod file.
      • From: Archibal Singleton <email@hidden>
References: 
 >Semantics of ^ in value bindings in .wod file. (From: Archibal Singleton <email@hidden>)
 >Re: Semantics of ^ in value bindings in .wod file. (From: Ulrich Köster <email@hidden>)
 >Re: Semantics of ^ in value bindings in .wod file. (From: Archibal Singleton <email@hidden>)

  • Prev by Date: Re: Semantics of ^ in value bindings in .wod file.
  • Next by Date: WO 5.4 for Windows PCs
  • Previous by thread: Re: Semantics of ^ in value bindings in .wod file.
  • Next by thread: Re: Semantics of ^ in value bindings in .wod file.
  • Index(es):
    • Date
    • Thread