Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flux pattern for .net

I'm learning React JS, which is a javascript library created by Facebook. For larger scale applications, it is highly recommended to use the Flux pattern/architecture.

The issue is that all the tutorials for React + Flux use Node ...

I find a dearth of tutorials for using Flux with .net ...

ReactJS.net is a good starting point for using React with .net, but stops short of implementing the Flux pattern on .net.

Can the Flux Pattern, which is currently used with React and Node, be used with React and .net?

like image 842
nanonerd Avatar asked Mar 29 '15 16:03

nanonerd


2 Answers

@Pickels is correct in noting that Flux is typically a front-end architecture. It was originally conceived to be only for the front end.

However, it has been adapted to a back-end architecture by a few people, notably by the folks at Yahoo. But Flux does not need to be the back end architecture to serve an isomorphic application with React.

I've noted two distinct approaches to how a React + Flux app can be served isomorphically. One is the Yahoo approach, and the Fluxible framework and their examples are a good place to start for examining that one. That's Node, as you said.

However, if you take a look at how Soundcloud has approached the problem, you'll see something quite different. Their back end is all in Scala. But they spin up a Nashorn instance and send a single initialization action through the Flux application in that instance to get an initial render of the React view layer. Then they send that down as HTML.

If you are looking for Flux-like things in the .NET community, you may want to check out application frameworks based on CQRS (Command Query Responsibility Segregation), which I believe has had some popularity in the .NET community for a while. The development of Flux was influenced somewhat by CQRS, dataflow programming and reactive programming, and CQRS is probably Flux's closest cousin in the family tree of architectural patterns.

like image 91
fisherwebdev Avatar answered Sep 27 '22 18:09

fisherwebdev


Not sure what examples you found but Flux is a front-end architecture which works with any back-end.

Depending on the implementation Flux stores can fetch data from a server but even in that case it's most likely calling a JSON end-point which is something all back-ends do.

like image 41
Pickels Avatar answered Sep 27 '22 19:09

Pickels