Since this thread was marked as OT, I figured I'd contribute an OT reply :)

It is worth noting that the syntax...

this.someProperty = property;

...is usually flagged by static code analysis tools because the incoming
parameter shadows that of the class.  True, using "this" disambiguates (is
that a word?!?) the reference and no harm is done.  I myself used to use
that syntax all the time.

However, I've gotten into the habit of doing...

public void setSomeProperty(String inSomeProperty) {
  someProperty = inSomeProperty;
}

...if for no other reason than to avoid the extra errors emitted by
CheckStyle and the like.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Fri, July 1, 2005 3:21 pm, [EMAIL PROTECTED] said:
>
>>From the javabean spec this is acceptable.  However, it is not good
>> coding
> standards to have a property in all upper case.  The java standard naming
> convention has constance as all upper case, properties as camel case.
> Struts would have a problem with this because it is looking for the first
> letter of the property to be lowercase.
>
> if this is a procedure name it would be better to have the parameter as
> either p813name or procP813NAME.
>
>
>
>              Ashish Kulkarni
>              <kulkarni_ash1312
>              @yahoo.com>                                                To
>                                        user@struts.apache.org
>              07/01/2005 02:54                                           cc
>              PM
>                                                                    Subject
>                                        [OT]java bean question
>              Please respond to
>                "Struts Users
>                Mailing List"
>              <[EMAIL PROTECTED]
>                   he.org>
>
>
>
>
>
>
> Hello
> I have java bean where in there is one property as
> below
> private java.lang.String P813NAME ;
> public void setP813NAME (java.lang.String P813NAME )
> {
> this.P813NAME = P813NAME;
> }
> public java.lang.String getP813NAME ()
> {
> return this.P813NAME ;
> }
>
> is this valid or not?
> if not why not and where i can find specification for
> java bean
>
> Ashish
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to