I built small mvc structure and I also created small basic Dependency Invoker based on Reflection class. My question is which one is best practice for using dependent class. For example I have class Call Request and I will use .
public function method(Request $request);
My Question is how to load Request class
-
Using Singleton and non static class var
class Request{ protected $var; }
-
Using New Instance with Static Var
class Request{ protected static $var; }