.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

StaticMethods And Public Methods

Posted By: Kannan C S     Posted Date: April 13, 2011    Points:5   Category :ASP.Net
Hi friends,
Can you please explain in what situation can I use static methods in my asp.net application.
Now I am in new company,They are using staic methods in classes for all functionalities.I dont think they are using standrds,eventhough I asked to one of the experienced guy,why you using static methods??..and also he is not allowing me to use public methods..I like coding like pure object oriented style...His answer was by using staic method it improves the performance of application...I dont think so....My question is,then why Dot.Net provides object oriented concept..??...his answer for static methods is not enough for me.....please ....

thanks in advance..

Author: Mahesh             
Posted Date: April 13, 2011     Points: 20   

Though it is right that only one object of static class is created but it will get destroyed as soon as your page processing is done since Web application is stateless hence nothing is preserved and that object belongs to the current user and and not others. Thus each user will have its own instance created and destroyed

If there is any performance difference between a static method and a non-static one, it'll be in the process of calling the method. Once you're into the method, both should execute identically.Static methods do significantly increase performance on repetitive methods done millions of times.but it is advisable to use instance method insted of static method.

for more details go through following link,


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend