0

I am working on one of my projects in MVC. I have created a common class which contains common methods.

To access all methods without instantiating i have created static methods. It saved creating instance of class all the time. Is it best practice? Can i have explaining scenarios for both uses?

Atul
  • 440
  • 8
  • 24
  • 2
    "Is it safe way / best practice to use methods? " - You _are_ using "methods" in both cases - static or not. Is it "safe" ? - Depends on your implementation and your definition of "safe". Is it best practice? To use static methods as default - not if you are following OOP clean code principles. – Fildor Aug 24 '17 at 07:57
  • 2
    Depends on a few more factors, testability needs etc. As is this question is "too broad". – H H Aug 24 '17 at 07:57
  • You need to edit your question to give the specific use case you have. I generally try to steer away from using static classes, but they have their uses sometimes. – Colin Mackay Aug 24 '17 at 07:58

0 Answers0