Another aspect of the MVC model is that developers can perform unit tests on the UI parts that cannot be tested in the traditional sense. Chad describes how Microsoft implements this:
Microsoft has taken a big step in the recent updates to the MVC Framework Beta, RC, and final release version. Compared with Preview 3, it has better support for unit testing. However, I still think that the excessive use of inheritance and Defense Code and the deliberate absence of interfaces make testing in ASP. NET MVC very cumbersome.
He continued to explain how FubuMVC implemented this model:
On the contrary, FubuMVC uses simple and easy mock interfaces, focusing on the design of high cohesion and low coupling. Among them, low coupling is more successful, but all this is still under development. I hope the future design can improve cohesion.
FubuMVC is highly dependent on the SOLID principle, which makes it highly flexible. developers can use only one mock to replace the entire set of components in the framework and use any mock framework they like.
FubuMVC does not have a lot of defensive code ...... Instead, it focuses on the design of components that provide free control. These components are the main points of the customer's code: controller), behavior, view) and can be overloaded.
There is almost no dependency between FubuMVC classes, and the only dependency is the interface dependency. These interfaces can be easily simulated using mock objects.
FubuMVC core framework
Because the project has the creator of the JeremyIoC container StructureMap), you may think that the control reversal and IoC containers will receive more support, as is the case in fact:
The current version only supports StructureMap, but it is likely to add support for other containers in the future. The framework is rarely used for containers and is only used for configuration. The other parts are completed using the automatic binding function of the container, so "service location" is basically not used ". For the only service location, we use the Common Service Locator of Microsoft Patterns and Practices for processing, it allows us to easily replace the IoC containers that are attached to the CSL mode. Most containers meet this condition ).
FubuMVC also has A contrib project, which has different objectives than the FubuMVC core framework:
We hope to have more freedom to develop FubuMVC, so we have established FubuMVC Contrib. We would like to try the plug-in so that more people can participate. They can make more attempts under fewer restrictions while maintaining the stability of the core framework.
The FubuMVC core framework will maintain a few members, so it will be more cautious with patches and have fewer modifications to the framework. FubuMVC-Contrib will have more participants, more changes, and lower requirements. It may be code that cannot work or experiment-type code. When something interesting is written in contrib, You can merge it into the core framework or split it into a separate project.
Currently, FubuMVC does not have ASP. net mvc is so mature, but its implementation method is very interesting. How will this framework develop. we will wait and see how different the development direction of net mvc will be. For more information about FubuMVC, refer to their wiki and Ryan Kelley's FubuMVC tutorial.
- Introduction to ASP. net mvc implementation
- How to send emails from ASP. NET 2.0
- Introduction to ASP. NET Applications
- ViewState nature in ASP. NET
- Installing ASP. NET AJAX