I have a question about MVC architecture.
I have a class that collects data from a WCF service, lets call it 'WCFDataAccess'. This class exposes many different methods to get or set data.
Inside of the Home Controller in MVC I often need to use this 'WCFDataAccess' class to collect data for each of the routes.
Index route would potentially create an instance of the WCFDataAccess object and collect data. A different route, say 'IndexDetails' also needs to create an instance of the WCFDataAccess object to collect data.
Can I share an instance of the 'WCFDataAccess' class by making it a private variable inside of the Home controller without negative performance impact? If two requests come in at the same time to the controller class how does using the private variable work?
An additional thought is to use the HttpContext.Current.Cache class.
Any suggestions?
Thanks!