Flux pattern for .net
Asked Answered
B

3

6

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?

Biz answered 29/3, 2015 at 16:9 Comment(1)
You are going to want to use github.com/pauldotknopf/react-aspnet-boilerplate It is a traditional react project in every sense of the word, except it is in .NET.Cockspur
G
9

@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.

Goldi answered 30/3, 2015 at 5:9 Comment(1)
Thanks guys. Trying to understand Flux. Will read again when I'm less tired and will try to digest this. Appreciate it.Biz
N
2

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.

Nipping answered 29/3, 2015 at 19:25 Comment(0)
C
1

Take a look at react-dot-not. It supports redux/flux. It is a typical React application in every sense, with isomorphic rendering and client-server side rendering.

Cockspur answered 7/3, 2016 at 4:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.