MVC
Assumptions:
- .NET Core + .NET 4.5.2
- ASP.NET MVC 5 + 6
- Java 8
- Spring MVC 4
Feature | In DXA | DD4T .NET | DD4T Java | Comments |
---|---|---|---|---|
Features of the controllers | ||||
Inject viewmodels using ModelBinder | No | Yes (in feature branch) | No | This belongs in the MVC discussion and not the model mapping discussion |
Controllers in the framework | Yes | Yes (abstract) | Yes (abstract) | Should this be in the core or in a module? Controllers should be owned by the customer according to Q |
Rendering regions | Separate region views | No region views | No region views | We want this in the new framework, because a. sometimes there is are extra HTML elements which are otherwise hard to do, and b. the product is moving in that direction as well |
Hook for custom CP logic | Override controller/action with metadata | Override controller/action with metadata | Override controller/action with metadata or use routing to intercept requests | The new framework will use View Components for ASP.NET MVC 6 (but still needs the old approach for MVC 5) |
Features of the view(resolver)s | ||||
XPM markup in views | Yes | Yes | Yes | |
Thymeleaf / non-JSP support for java | No | n.a. | No | |
Rendering component presentations | Triggered by tag | Triggered by view helper | Triggered by tag | For .NET we will adopt View Component approach. https://docs.asp.net/en/latest/mvc/views/view-components.html. It is important that this can be customized in implementations, e.g. to run a broker query or access an external service. |