• 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: synchronizesVariablesWithBindings()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: synchronizesVariablesWithBindings()


  • Subject: Re: synchronizesVariablesWithBindings()
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 21 Aug 2012 12:22:49 -0700

Hi Miguel,

On 2012-08-21, at 11:19 AM, WebObjects TORAcom wrote:

> Hi List,
>
> I am trying to implement best practices in our applications, we want to take control of component's  binding syncrhonization.
>
> First of all I understand that we should override the synchronizesVariablesWithBindings function like this:
>
>
> public boolean synchronizesVariablesWithBindings() {
> 		return false;
> 	}
>
>
>
> But where in the request - response loop should be the better place to synchronize our bindings, a lot of time ago (years) somewhere in the internet I found info that recommends Pull binding's values in the takeValuesFromRequest(WORequest r, WOContext c) method and Push binding's values in the appendToResponse(WOResponse r, WOContext c).
>
> I am not sure about that, so we have been working with the automatic synchronization of our bindings.

I usually do lazy synchronization, and only do what I need.  Something like this:


private String exampleValue;

public void awake() {
	super.awake();
	exampleValue = null;
}

public String exampleValue() {
	if (exampleValue == null) {
		exampleValue = stringValueForBinding("exampleValue");
	}
	return exampleValue;
}

public void setExampleValue(String newValue) {
	if (ERXExtensions.saveDifferent(exampleValue, newValue) {
		setValueForBinding(newValue, "exampleValue");
		exampleValue = newValue;
	}
}


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/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

  • Follow-Ups:
    • Re: synchronizesVariablesWithBindings()
      • From: WebObjects TORAcom <email@hidden>
References: 
 >synchronizesVariablesWithBindings() (From: WebObjects TORAcom <email@hidden>)

  • Prev by Date: synchronizesVariablesWithBindings()
  • Next by Date: Re: synchronizesVariablesWithBindings()
  • Previous by thread: synchronizesVariablesWithBindings()
  • Next by thread: Re: synchronizesVariablesWithBindings()
  • Index(es):
    • Date
    • Thread