Jose Sandoval Google
 Resume     Book     Software     Drawings     Home     Subscribe to RSS feed Search Web Search josesandoval.com

Static or instance calling?
Monday, November 08, 2004

I have always debated if static method calls are OO or procedural programming. I think there is a middle ground for this one.

I also had an interest to know if there was a performance hit by calling one or the other. So I wrote this article/blog entry called Using static or instance methods, together with a small test class.

The sample code is very generic and perhaps too small to come to any conclusion. So don't take my sample as anything scientific or based on any long-term statistics. This is only a sample to convince myself that static methods are a bit faster to execute than instance method. I.e. there is no instance of the class, for one.

I'm sure there is some code out there that will give better performance with either static or instance calling. In the end, it's the design that should drive your choice of method calling. Static method calls don't look too OOish, however, they have a place in OO design.


5:30 PM | 1 comment(s) |

Comments:

http://www.jroller.com/page/alanli/20041110#hello_world
By Anonymous Anonymous, at 3:13 AM



This page is powered by Blogger. Isn't yours?

Guestbook
© Jose Sandoval 2004-2009 jose@josesandoval.com