• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JavaBean

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a simple question about Java Bean.

The following code has been taken from the following page:
http://en.wikipedia.org/wiki/JavaBean


Now my question is, if we have a getDeceased method such as

,

will I be breaking the JavaBean naming convention?

And secondly, is the Different syntax for a boolean field (is vs. get) only for boolean variables?



 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Swagato Bhatta wrote:
Now my question is, if we have a getDeceased method such as

,

will I be breaking the JavaBean naming convention?



Not really, but Java Bean design theory suggest to use isDeceased(), which is good and convey what it returns. Also this.Deceased; throws error.

Swagato Bhatta wrote:And secondly, is the Different syntax for a boolean field (is vs. get) only for boolean variables?


Yes.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic