ReactiveUI 是属于 .Net 基金会的一个项目，本文将简要介绍该项目相关的信息。
ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming which is a paradigm that allows you to express the idea around a feature in one readable place, abstract mutable state away from your user interfaces and improve improve the testability of your application.
It is the father of the extremely popular ReactiveCocoa framework. Internally the maintainers debate whether ReactiveUI is or is not a framework, as at its core the project is essentially a bunch of extension methods for the Reactive Extensions.
We believe that code is communication between people, that also happens to run on a computer. If you optimise for humans, then over a long time your project will end up better. Software should be understandable by other people; that is super important. We believe that only the power of the Reactive Extensions allows you to express the idea around a feature in one readable place.
Let’s say you have a text field, and whenever the user types something into it, you want to make a network request which searches for that query. Your designer has requested that this search query automatically execute as the user is typing but your operation team wants guarantees that only one network request is ever in transit and no more frequently than roughly once per second whilst the user is typing.
Most modern programming today is basically imperative, meaning it models the traditional fetch-execute cycle of a CPU. Perform an instruction, fetch the next one. Perform that one, and so on. For decades, programmers have had to mould their brains to fit the paradigm of the CPU. It’s been like this since the early 1980s.
When we rely on hoping that the behavior that emerges from a program is correct, and that reliance is based on nothing more than a programmer’s correctness, then we can easily find ourselves in a sticky situation. We can try and mitigate the costs of imperative programming with things like unit tests or integration tests, but why mitigate the costs when there’s a better way?
Long ago, when computer programming first came to be, machines had to be programmed quite manually. If the technician entered the correct sequence of machine codes in the correct order, then the resulting program behavior would satisfy the business requirements. Instead of telling a computer how to do its job, which error-prone and relies too heavily on the infallibility of the programmer, why don’t we just tell it what it’s job is and let it figure the rest out?
ReactiveUI is inspired by the paradigm of Functional Reactive Programming, which allows you to model user input as a function that changes over time. This is super cool because it allows you to abstract mutable state away from your user interfaces and express the idea around a feature in one readable place whilst improving application testability. Reactive programming can look scary and complex at first glance, but the best way to describe reactive programming is to think of a spreadsheet:
- Three cells, A, B, and C.
- C is defined as the sum of A and B.
- Whenever A or B changes, C reacts to update itself.
That's reactive programming: changes propagate throughout a system automatically. Welcome to the peanut butter and jelly of programming paradigms.
以上《英文介绍》摘录自 .NET Foundation 的项目介绍 。原文受原项目许可证保护。
- ASP.NET SignalR
- ASP.NET MVC, Web API and Web Pages (Razor)
- ASP.NET Ajax Control Toolkit
- ASP.NET Core
- Microsoft Azure SDK for .NET
- Microsoft Azure WebJobs SDK
- Chemistry Add-in for Word
- Couchbase Lite for .NET
- DNN Platform
- .NET Compiler Platform ("Roslyn")
- .NET Micro Framework
- .NET SDK For Hadoop
- DotVVM: Component-based MVVM framework for ASP.NET
- Entity Framework
- Managed Extensibility Framework (MEF, MEF2)
- Microsoft Web Protection Library
- MVVM Light Toolkit
- .NET Core
- NUnit Test Framework
- Open Live Writer
- Open XML SDK
- Orchard CMS
- OWIN Authentication Middleware (Katana Project)
- Peachpie Compiler Platform
- Reactive Extensions for .NET
- Salesforce Toolkits for .NET
- System.Drawing (Mono)
- Telerik UI for UWP
- UWP Community Toolkit
- Windows Phone Toolkit
- Windows Template Studio
- Windows Forms
- WiX Toolset
- WorldWide Telescope
- Windows Presentation Foundation (WPF)