Monday, February 21, 2011

defining asmx webservice class objects as static

Hi,

is it better to declare Webservice class object instances as static as the .asmx webservice classes have only static methods.

what i want is that i declare and instantiate webservice asmx class as static in aspx Page Behind Class.

and on every event call on that page i could perform operation against webservice methods.

is it beneficial in terms of performance?

Thanks

Usama

From stackoverflow
  • Actually there are no "static classes" .. there are static members (variables,methods). static class is sth of .net2.0 that forces every member to be static. and that's about it. In addition to the fact: "static" and "instance" are opposites - you can't instantiate a static class. – John Saunders Mar 11 at 3:18

0 comments:

Post a Comment