Override synchronizesVariablesWithBindings() or isStateless()?
Override synchronizesVariablesWithBindings() or isStateless()?
- Subject: Override synchronizesVariablesWithBindings() or isStateless()?
- From: Kieran Kelleher <email@hidden>
- Date: Thu, 18 Mar 2004 15:06:36 -0500
In the Apple examples, we have ExampleBody in the ExamplesHarness (code
shown below).
I notice they are overriding synchronizesVariablesWithBindings and
returning false. Am I correct in assuming that this is the way this
example implements a stateless component? Does not overriding the
isStateless method and returning true do the same thing? In fact would
I be more correct to override isStateless and returning true rather
than overriding synchronizesVariablesWithBindings and returning false?
The sentence
"This method returns false for stateless components (unless you
override isStateless and return true), and true otherwise"
at
http://developer.apple.com/documentation/WebObjects/Reference/API/
index.html
is confusing to me?!
Is it saying I should override isStateless to return true and the
synchronizesVariablesWithBindings will automatically return false? (the
"unless" word does not clarify)
- Kieran
/*
* WOExampleBody.java
* [WOExamplesHarness Project]
*/
package webobjectsexamples.examplesharness;
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
public class WOExampleBody extends WOComponent {
public WOExampleBody(WOContext context) {
super(context);
}
public boolean synchronizesVariablesWithBindings() {
return false;
}
}
________________________________________________________________
Config = OS X 10.3.2 / Java 1.4.1 / WO 5.2.2 / MySQL 4.0.18 /
Connector-J 3.0.11
Blog: http://webobjects.webhop.org/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.