What are the mvvm frameworks?
The mvvm framework includes: 1. MVVMLight framework, a lightweight framework that implements the MVVM pattern; 2. Prism framework; 3. Caliburn framework, an open source framework for MVVM classes; 4. MVVM Helpers framework; 5. Cinch framework; 6. MVVM Foundation framework
##The framework to implement MVVM
1. The most powerful and versatile composition framework - Prism
Download address: http://compositewpf.codeplex.com/Developer: Microsoft patterns & practices team Whether Silverlight is supported: YesLearning materials: Composite Application Guidance for WPF and Silverlight - May 2010.chm and Quickstarts and StockTraderRI, etc. Source code screenshots are as follows:##Prism——previously called Composite Application Guidance for WPF and Silverlight, it is a complex enterprise-level application based on WPF/Silverlight Mainstream application framework. There are several important concepts in Prism:
1. BootStrapper: The application entry point, inherits Prism's UnityContainer or the MefUnityContainer provided by MEF, and provides a container for the system.
2, Shell: It is a shell that layouts pages through UI elements and Regions. It is the top-level window of the application, and the displayed content is generally filled by View. The Shell itself does not know what content it contains, so the functions are specifically provided by each Module.
3, View: It is equivalent to View in MVP mode and MVVM mode. It can be injected into Region through IRegionManager.
4, Module: A large project can be split into parts. Each Module contains View, data, and model, and is mainly used to implement complex business operations.
5, IModuleManager: mainly used to manage module loading and can achieve dynamic loading.
6, IEventAggregator: event processing interface, implementing subscription and publishing modes, which is also the general practice of MVVM framework.
Prism is a relatively large combination framework. It has become more powerful after the introduction of MEF and functional adjustments in 4.0. Now it can be said to be the unity of the combination framework and application framework, and it is the strength of the Microsoft team, so I chose It's worth guaranteeing.
Download address: http://caliburn.codeplex.com/
Developer: Rob Eisenberg
Does Silverlight support: Yes
Learning materials: I mainly refer to project examples, source code, unit test cases, and some foreign blogs and communities.
Source code screenshots are as follows:
There are several important concepts in Caliburn:
1, Commands based on Actions There are many features, including multiple parameters, filter operations, and asynchronous calls.
2. The life cycle events of forms and controls are also handled relatively well (including activation, deactivation, shutdown, etc.).
3. The testability of both the entire framework and applications based on this framework is relatively good.
4, provides many common functions, which are more useful in projects.
5, in addition to supporting the MVVM mode, it also supports the MVP mode and other variant modes.
6, powerful dependency injection framework and AOP framework, you can flexibly choose one of them here.
Caliburn is a very powerful MVVM application framework that provides flexible and diverse implementations of many functions. Whether it is project use or code research, I feel that it has benefited a lot.
3. Lightweight and applicable MVVMLightMVVMLight is a lightweight framework that implements the MVVM pattern (relative to Prism), which can better help us Develop WPF, Windows Phone, Windows 8, SilverLight related projects.
Laurent Bugnion, the author of MVVMLight, is a Microsoft MVP. The author open sourced the code to Codeplex: http://mvvmlight.codeplex.com/.
MVVMLight’s official website: http://www.mvvmlight.net/, which has detailed introduction and video documents. If you are interested, you can learn more.
Download address: http://mvvmlight.codeplex.com/
Developer: Laurent Bugnion
Support Silverlight: Yes
Learning materials: In addition to online documentation, I mainly refer to project examples, source code, unit test cases, and some foreign blogs and communities. In addition, these three articles are very good. I developed a relatively complete Silverlight enterprise project using MVVMLight
- Part 1 - Introduction, Installation, and General Application Design Topics
- Part 2 - MVVM Light Topics
- Part 3 - Custom Authentication, Reset Password and User Maintenance
- The source code screenshot is as follows:
There are several important concepts in MVVMLight:
1, RelayCommand: By encapsulating Command, the MVVM mode is easier to use on WPF and Silverlight. You only need to define each RelayCommand in the ViewModel, and then use the Command to bind the RelayCommand defined in the ViewModel in the View to achieve the same effects as WinForm and ASP.NET events, but here the UI and logic are removed strong coupling.
2, Messager: The Messager in MVVMLight plays a relatively large role. As mentioned earlier, the MVVM mode removes the strong references of ViewModel and View, so how do they interact? It is used to allow ViewModel and View to communicate. Generally, we will define a static AppMessages class as a general communication class. The principle is the publish-subscribe model.
3, EventToCommand: This is similar to the concept of additional behavior, which was introduced in MVVM Light Toolkit V3.
4, ICleanup interface: When displaying a View, you need to first call the Cleanup method to clear the data. This is also some necessary operations due to the coupling isolation of ViewModel and View.
MVVMLight is a very easy-to-use MVVM framework that provides templates and intelligent sensing for VS and Blend. It feels really lightweight and efficient when used in combination with MEF, and it provides support for WPF and Silverlight, especially Silverlight support, so generally choose the lightweight Silverlight MVVM mode, which is more promising.
4. Full-featured and easy-to-use MVVM Helpers
Download address: http://mvvmhelpers.codeplex.com/
Developer: Mark Smith
Whether to support Silverlight: No
Learning materials: http://www.julmar.com/blog/mark/ and the provided examples, source code and test cases.
The source code screenshot is as follows:
5, powerful and lightweight Cinch
Download address: http://cinch.codeplex.com/Developer: Sacha Barber Whether Silverlight is supported: NoLearning materials: http://sachabarber.net/ and provided examples, source code and test cases. The screenshot of the source code is as follows:6. MVVMFoundation with simple functions and easy expansion
Download address: http://mvvmfoundation.codeplex.com/Developer: Josh SmithWhether it supports Silverlight: NoLearning materials: http://joshsmithonwpf.wordpress.com/ and the provided examples, source code and test cases. Source code screenshots are as follows:4, RelayCommand interface: encapsulates the command statement, including execution execution logic, optional can-execute logic, etc. Externally, you only need to instantiate and Binding to use it easily.
MVVMFoundation is a very simple MVVM framework. If you find it difficult to study the source code, you can start with this framework first. The code is simple and refined.
For more programming-related knowledge, please visit: Programming Learning Website! !
The above is the detailed content of What are the mvvm frameworks?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Evaluating the cost/performance of commercial support for a Java framework involves the following steps: Determine the required level of assurance and service level agreement (SLA) guarantees. The experience and expertise of the research support team. Consider additional services such as upgrades, troubleshooting, and performance optimization. Weigh business support costs against risk mitigation and increased efficiency.

The learning curve of a PHP framework depends on language proficiency, framework complexity, documentation quality, and community support. The learning curve of PHP frameworks is higher when compared to Python frameworks and lower when compared to Ruby frameworks. Compared to Java frameworks, PHP frameworks have a moderate learning curve but a shorter time to get started.

The lightweight PHP framework improves application performance through small size and low resource consumption. Its features include: small size, fast startup, low memory usage, improved response speed and throughput, and reduced resource consumption. Practical case: SlimFramework creates REST API, only 500KB, high responsiveness and high throughput

According to benchmarks, for small, high-performance applications, Quarkus (fast startup, low memory) or Micronaut (TechEmpower excellent) are ideal choices. SpringBoot is suitable for large, full-stack applications, but has slightly slower startup times and memory usage.

Writing clear and comprehensive documentation is crucial for the Golang framework. Best practices include following an established documentation style, such as Google's Go Coding Style Guide. Use a clear organizational structure, including headings, subheadings, and lists, and provide navigation. Provides comprehensive and accurate information, including getting started guides, API references, and concepts. Use code examples to illustrate concepts and usage. Keep documentation updated, track changes and document new features. Provide support and community resources such as GitHub issues and forums. Create practical examples, such as API documentation.

Choose the best Go framework based on application scenarios: consider application type, language features, performance requirements, and ecosystem. Common Go frameworks: Gin (Web application), Echo (Web service), Fiber (high throughput), gorm (ORM), fasthttp (speed). Practical case: building REST API (Fiber) and interacting with the database (gorm). Choose a framework: choose fasthttp for key performance, Gin/Echo for flexible web applications, and gorm for database interaction.

There are five misunderstandings in Go framework learning: over-reliance on the framework and limited flexibility. If you don’t follow the framework conventions, the code will be difficult to maintain. Using outdated libraries can cause security and compatibility issues. Excessive use of packages obfuscates code structure. Ignoring error handling leads to unexpected behavior and crashes.

In Go framework development, common challenges and their solutions are: Error handling: Use the errors package for management, and use middleware to centrally handle errors. Authentication and authorization: Integrate third-party libraries and create custom middleware to check credentials. Concurrency processing: Use goroutines, mutexes, and channels to control resource access. Unit testing: Use gotest packages, mocks, and stubs for isolation, and code coverage tools to ensure sufficiency. Deployment and monitoring: Use Docker containers to package deployments, set up data backups, and track performance and errors with logging and monitoring tools.
