In an MVC3 application, I need to construct a domain object from values contained in the incoming Http Request. The logic is sufficiently complex that I have created a factory class with the responsibility of creating my domain object.
My question is whether to pass into this factory class the value of the Controller's Request property, or should I reference the value of the static HttpContext.Request property from inside the factory class?
My intention is to unit test both the controller and the factory class so I will have perform the necessary overhead of setting up the HttpContext somewhere. I just wondered if there are any general rules to stick to?