• 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: [ANN] WO/WOLips/Wonder intro screencast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] WO/WOLips/Wonder intro screencast


  • Subject: Re: [ANN] WO/WOLips/Wonder intro screencast
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 21 Mar 2008 09:11:46 -0700


On Mar 21, 2008, at 8:56 AM, Louis Demers wrote:


On 21-Mar-08, at 00:46 , Lachlan Deck wrote:
* probably helpful to explain why you're making the ivars public (i.e., in the absence of getter/setters)

not to start another philosophical debate... but I always get a guilty feeling if I declare them public instead of private with getters/setters. But when I review the code of my many components, the majority of the code is just these getters/setters and I never used them to do any thing else because I get that feeling that too is not recommended.


My own philosophy (from my ObjC/C/Asm background) is, the less code, the fewer bugs. The getters/setters certainly aren't buggy but they crowd the code files.

What would be compelling reasons in Java (within the context of WO dev) not to go with public declarations ? What do you advise when doing WO/WOnder development ?


My rule is this: If the Java code for the component refers to the variables, I make getters and setters and use them in the code. If the variable is only referred to in bindings, I make it public. This ties in with my other rule: only constructors, getters, and setters may access a variable directly. All other uses refer to the getter (accessor). And the constructor is only allowed to do that if there is no setter method.


Chuck

--

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/products/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


References: 
 >[ANN] WO/WOLips/Wonder intro screencast (From: David LeBer <email@hidden>)
 >Re: [ANN] WO/WOLips/Wonder intro screencast (From: Mike Schrag <email@hidden>)
 >Re: [ANN] WO/WOLips/Wonder intro screencast (From: Lachlan Deck <email@hidden>)
 >Re: [ANN] WO/WOLips/Wonder intro screencast (From: Louis Demers <email@hidden>)

  • Prev by Date: Re: [ANN] WO/WOLips/Wonder intro screencast
  • Next by Date: Re: How to target a WO component in an html include
  • Previous by thread: Re: [ANN] WO/WOLips/Wonder intro screencast
  • Next by thread: Re: [ANN] WO/WOLips/Wonder intro screencast
  • Index(es):
    • Date
    • Thread