• 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

Reg : Chapter 12 - Message Reduction

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jack,
you suggested to use a combined method execution to reduce the number of messages. That is indeed a good idea. But how many times we end up updating/setting all the values at the same time? will it be a good idea to add more methods to the interface (i.e. for updating two methods at a time..bool & num, num & string, string & bool) or is it better to do
setAll(new boolValue, new numValue, getStringValue) when we intend to set num and bool but not the String....
 
Author
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not really a performance issue, more a design and coding practices issue. Some people prefer the multiple methods, some prefer one method which accepts null or a special object or value for those parameters which are not to be updated.
Performance tuning is often a tradeoff. In this case you are trading simplicity of the class definition for reduced distribution overheads.
--Jack Shirazi
JavaPerformanceTuning.com
 
reply
    Bookmark Topic Watch Topic
  • New Topic