- Flux Architecture
- Adam Boduch
- 354字
- 2021-07-16 10:49:00
Flux isn't another framework
Now that we've explored some of the high-level patterns of Flux, it's time to revisit the question: what is Flux again? Well, it is just a set of architectural patterns we can apply to our frontend JavaScript applications. Flux scales well because it puts information first. Information is the most difficult aspect of software to scale; Flux tackles information architecture head on.
So, why aren't Flux patterns implemented as a framework? This way, Flux would have a canonical implementation for everyone to use; and like any other large scale open source project, the code would improve over time as the project matures.
The main problem is that Flux operates at an architectural level. It's used to address information problems that prevent a given application from scaling to meet user demand. If Facebook decided to release Flux as yet another JavaScript framework, it would likely have the same types of implementation issues that plague other frameworks out there. For example, if some component in a framework isn't implemented in a way that best suits the project we're working on, then it's not so easy to implement a better alternative, without hacking the framework to bits.
What's nice about Flux is that Facebook decided to leave the implementation options on the table. They do provide a few Flux component implementations, but these are reference implementations. They're functional, but the idea is that they're a starting point for us to understand the mechanics of how things such as dispatchers are expected to work. We're free to implement the same Flux architectural pattern as we see it.
Flux isn't a framework. Does this mean we have to implement everything ourselves? No, we do not. In fact, developers are implementing Flux libraries and releasing them as open source projects. Some Flux libraries stick more closely to the Flux patterns than others. These implementations are opinionated, and there's nothing wrong with using them if they're a good fit for what we're building. The Flux patterns aim to solve generic conceptual problems with JavaScript development, so you'll learn what they are before diving into Flux implementation discussions.
- JSP網絡編程(學習筆記)
- Python科學計算(第2版)
- Swift 3 New Features
- Scratch真好玩:教小孩學編程
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- 從零開始學Linux編程
- Django實戰:Python Web典型模塊與項目開發
- OpenStack Networking Essentials
- Webpack實戰:入門、進階與調優(第2版)
- PHP與MySQL權威指南
- Java7程序設計入門經典
- WCF技術剖析(卷1)
- Java編程指南:語法基礎、面向對象、函數式編程與項目實戰
- Python網絡爬蟲從入門到實踐
- MonoTouch應用開發實踐指南:使用C#和.NET開發iOS應用