Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

final getter/setter methods in valueobject classes  RSS feed

 
Viral Thakkar
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was wondering if all the getXXX methods in the Value Objects should be declared as final.

I mean, is there any performance gain by making the get/set methods as final. These value object classes are used inside my ejb beans.

Regards,
Viral
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there might be some performance gain from making them final, but it will depend on the JVM used and likely always be marginal.

So I wouldn't care about it until I had a proven performance problem, and then I'd probably look elsewhere for the bottleneck. If I still decided to try it, I'd suggest running a before/after experiment to be sure.

Does that help?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!