Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guidelines for when to use Static class over instance class? [duplicate]

Tags:

Possible Duplicate:
When to Use Static Classes in C#

Can someone please provide guidelines , standard checkpoints on when to create static class and when to create instance class.

Basically many a times I see while writing a code that the same thing could have been done using static class and methods and i get confused with many things.

So far i know below check points :

  1. If object under the consideration can exists only once in entire application then it would come under "static"

  2. If a method does not use any field variable inside it then it can be static method.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!