Search code examples
javamodel-view-controllerdependency-injectionguicegwt-gin

Dependency Injection for MVC


I know DI is mostly used with MVP pattern however, where does Google Gin fits into a Model-View-Controller framework/pattern?

For example, usually for a MVC a View holds references to the Model (in which it listen to change events) and the Controller holds references to the Model and the View. I mean how I can improve a MVC pattern using DI.


Solution

  • DI has nothing to do with MVC or MVP, it's IOC pattern which abstracts the dependencies for cleaners/easier unit testing and decoupling via DI container.