On Jul 3, 2006, at 9:01 AM, Theodore Petrosky wrote:

While adding a key to WO builder, it says that the
variable will be defined as:
protected string <stringname>;

however they come in as:
public string <stringname>;

If when you add a key in WO builder, you choose to add only an instance variable but no accessor methods, the variable will be declared "public" so that WO can access the variable directly. If you choose to create at least one accessor method, the variable will be declared "protected" because WO won't need to access the variable directly.

Personally, I never choose to create just an instance variable because, to me, that minimizes encapsulation and makes debugging difficult (there's no accessor method on which to set a break point). I also change the instance variable declaration to "private" so that access by any objects that aren't members of the current class must occur via accessor methods. This can minimize problems caused by accessing the instance variable directly.

I don't know enough java to understand the difference
and why there was a change from the version the books
talk about and the 5.3 that I downloaded.

It's really important to understand Java well. Learning the WO API is daunting enough, but if you aren't confident about Java, you'll have an even more difficult road ahead.

Aloha,
Art

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to