static methods
2 posts in topic
Flat View  Flat View

Posted By:   Ganesan_Sethumadhavan
Posted On:   Thursday, March 25, 2004 08:19 PM

Lot of utility methods used across the entire application are defined as static methods inside a class for convenience. While these methods can be bundled in meaningful classes, concern is there regarding numerous object creation and inturn the increase in gc cycles. How to ensure that bundling really reduces the footprint required by the application withou affecting performance?


Re: static methods

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, April 5, 2004 06:38 AM

I think (?) that a call to a static method doesn't require an object of the class, so the bundling shouldn't affect object creation (no object is needed to be created, regarldess of where a static method lives).

Re: static methods

Posted By:   Arvind_Ajimal  
Posted On:   Monday, April 5, 2004 04:53 AM

The main idea is to have methods as we have EJBs.

think of ur methods as they are EJBs.

All those who fall parallel to session( stateless )
beans i.e. methods having functionality to do simple
processes, calculations etc where user session or transactions are of not much importance, will come in the category of STATIC methods ( like a methods that
converts given celcius value to farhnt value for some user use ). OR a premium calculator method for a given input on a policy and user data.

And all methods that need persistance data or rely heavily on user session and transaction ( i.e. fall parallel to Entity beans ) should be non static, non final and can be public, private or protected depending on design.
About | Sitemap | Contact