I have a typical web application with the controllers calling the business methods. Should the methods in the business classes be implemented using static methods or instance methods. The business layer classes doe not maintain any state information.
Some additional information + The business classes do not maintain state specific information. + Would instantiating these objects on a per request basis consume a lot of memory as opposed to using static methods
Does "yes" count as an answer? I hate to say it, but both answers are valid; choosing between them requires context. If you have no use for per-instance state, then: why create instances? However, it should be noted that per-instance state is useful for IoC/DI scenarios, which in turn are handy for testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With