• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reg : Chapter 12 - Message Reduction

 
Arvind Varma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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....
 
Jack Shirazi
Author
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!