• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question 5 page 78

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer says that 'add', 'delete' and 'put' are not standard javabeans name prefixes,

but
Two min drill on page 68, 4th line on first paragraph, states that add is standard java beans

It is an error, isn't it

so add is standard javabeans name prefix or not ??
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's touchy. I've seen this debated before.

Properties usually use get, set and is for booleans. But technically, add is a valid prefix for listeners, such as addActionListener.

It's certainly arguable.

-Cameron McKenzie
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mohammed,

Yeah, we've discussed this before - we're going to clarify the discussion of Listener names earlier in the chapter, and then we're going to clarify this answer. The bottom line is that "add" is ONLY standard for "Listener" methods, and "Listener" methods MUST have the word "Listener" in them.

hth,

Bert

p.s. hmmm... I thought I'd updated the errata list with that - sorry - I'll right on that!
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mohammed,

Here is a link to the JavaBeans naming conventions.
[ UD: removed links to copyrighted material ]

Cheers,

Alex
[ August 03, 2007: Message edited by: Ulf Dittmer ]
 
Costa lamona
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks

Actually (K & B) is a very good book, I am going next week to finish this story armed with what I have learn from it, but I am scared like hell!!
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The bottom line is that "add" is ONLY standard for "Listener" methods, and "Listener" methods MUST have the word "Listener" in them.



I think remove is also a standard javabeans method prefix,the method must have a word "Listener" in them.

e.g.
public void removeEListener(EListener)
public void removePListener(VetoableChangeListener)
public void removeVetoableChangeListener(VetoableChangeListener)
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic