I am trying to implement an Onion architecture for a ASP.Net MVC 5 project. I have seen opinions that services should be injected rather than instantiated even though, correct me if I am wrong, the idea expressed by Jeffery Palermo (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/) was that any outer layer should be able to directly call any inner layer. So my question is
- Can the onion architecture work without IOC, and if yes, is it ideal?
- Let's say we go with IOC, if the UI should not know about the actual implementation of domain services, should we apply the same principle to the domain models themselves e.g. injecting models into the UI instead of referencing them directly?
I am understand why some solutions apply IOC on domain services but are accessing the domain models directly in the controllers.