Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Facebook: MVC does not scale, use Flux instead

Facebook: MVC does not scale, use Flux instead

Scheduled Pinned Locked Moved The Insider News
asp-netcomregexarchitectureannouncement
12 Posts 5 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    InfoQ[^]:

    Facebook came to the conclusion that MVC does not scale up for their needs and has decided to use a different pattern instead: Flux.

    Because MVC is sooooo 1980s

    D J C M 4 Replies Last reply
    0
    • K Kent Sharkey

      InfoQ[^]:

      Facebook came to the conclusion that MVC does not scale up for their needs and has decided to use a different pattern instead: Flux.

      Because MVC is sooooo 1980s

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      Facebook's consistency requirements and data are pretty atypical cases I'd imagine. Also having an almost unlimited pot of fairy dubloons means they couldn't care less about developer productivity. All that said - quite an interesting article. The pity is that it will be used by those who know little as ammunition to reduce all formal process to "copy blocks from google and give it a try".

      1 Reply Last reply
      0
      • K Kent Sharkey

        InfoQ[^]:

        Facebook came to the conclusion that MVC does not scale up for their needs and has decided to use a different pattern instead: Flux.

        Because MVC is sooooo 1980s

        J Offline
        J Offline
        Jeremy Falcon
        wrote on last edited by
        #3

        The view should never have direct access to the model. That's one of the things MVVM addresses. I like the simplified design of Flux they're talking about, but I'd still add a client-side VM layer on top of it for the extra layer of abstraction. Maybe something like FluxVM or FVM. Sounds nice.

        Jeremy Falcon

        1 Reply Last reply
        0
        • K Kent Sharkey

          InfoQ[^]:

          Facebook came to the conclusion that MVC does not scale up for their needs and has decided to use a different pattern instead: Flux.

          Because MVC is sooooo 1980s

          C Offline
          C Offline
          CatchExAs
          wrote on last edited by
          #4

          Wait.... so they invented the Windows Message Queue.... but in a web server? Old stuff == New stuff.

          1 Reply Last reply
          0
          • K Kent Sharkey

            InfoQ[^]:

            Facebook came to the conclusion that MVC does not scale up for their needs and has decided to use a different pattern instead: Flux.

            Because MVC is sooooo 1980s

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #5

            The irony of that is sweet. I recently co-wrote a kiosk application. It never really looked MVC. We had a "Metastore" (heh, notice the similarity in names) that contained all the data, and our dispatcher was a very cool state manager that I wrote. The views were WPF. Now I have a name for that kind of architecture. Flux! Marc

            J 1 Reply Last reply
            0
            • M Marc Clifton

              The irony of that is sweet. I recently co-wrote a kiosk application. It never really looked MVC. We had a "Metastore" (heh, notice the similarity in names) that contained all the data, and our dispatcher was a very cool state manager that I wrote. The views were WPF. Now I have a name for that kind of architecture. Flux! Marc

              J Offline
              J Offline
              Jeremy Falcon
              wrote on last edited by
              #6

              Marc Clifton wrote:

              and our dispatcher was a very cool state manager that I wrote.

              Was it bidirectional? I'm putting together a design for a new site and right now I see the only way to pull it off is with the dispatcher / controller being bidirectional.

              Jeremy Falcon

              M 1 Reply Last reply
              0
              • J Jeremy Falcon

                Marc Clifton wrote:

                and our dispatcher was a very cool state manager that I wrote.

                Was it bidirectional? I'm putting together a design for a new site and right now I see the only way to pull it off is with the dispatcher / controller being bidirectional.

                Jeremy Falcon

                M Offline
                M Offline
                Marc Clifton
                wrote on last edited by
                #7

                Jeremy Falcon wrote:

                Was it bidirectional?

                Well, with WPF / MVC, things are a mess. The view can update the model because you want the property changed event to trigger, for example. The clarity that we achieved is that view has its view-model and can do anything within that limited scope -- it owns it's own domain, if you will. However, anything that affects the model that the rest of the world sees goes through the dispatcher (which can be property change events but is usually a button click event or some external thing like a card swipe, bill acceptor read, or some device erroring out.) That was the theory. In reality, it was simpler to allow the view to update the model and thus it was bidirectional. But that's because certain fields, like zipcode, seemed ridiculous to go through and action->dispatcher->store sequence to update something that was exclusively informational. Marc

                J 1 Reply Last reply
                0
                • M Marc Clifton

                  Jeremy Falcon wrote:

                  Was it bidirectional?

                  Well, with WPF / MVC, things are a mess. The view can update the model because you want the property changed event to trigger, for example. The clarity that we achieved is that view has its view-model and can do anything within that limited scope -- it owns it's own domain, if you will. However, anything that affects the model that the rest of the world sees goes through the dispatcher (which can be property change events but is usually a button click event or some external thing like a card swipe, bill acceptor read, or some device erroring out.) That was the theory. In reality, it was simpler to allow the view to update the model and thus it was bidirectional. But that's because certain fields, like zipcode, seemed ridiculous to go through and action->dispatcher->store sequence to update something that was exclusively informational. Marc

                  J Offline
                  J Offline
                  Jeremy Falcon
                  wrote on last edited by
                  #8

                  Marc Clifton wrote:

                  The clarity that we achieved is that view has its view-model and can do anything within that limited scope -- it owns it's own domain, if you will. However, anything that affects the model that the rest of the world sees goes through the dispatcher (which can be property change events but is usually a button click event or some external thing like a card swipe, bill acceptor read, or some device erroring out.)

                  This is what I'm going with. At first I called it MVVMC, but now I'm not sure since it's a "controller" in MVC compared to a dispatcher, but whatever. I'm liking it this though, and I'm ok with having a VM update going requiring an action that filters through the dispatcher. Not sure what the hell to call it though, as I don't think "Flux" supports ViewModels.

                  Jeremy Falcon

                  M 1 Reply Last reply
                  0
                  • J Jeremy Falcon

                    Marc Clifton wrote:

                    The clarity that we achieved is that view has its view-model and can do anything within that limited scope -- it owns it's own domain, if you will. However, anything that affects the model that the rest of the world sees goes through the dispatcher (which can be property change events but is usually a button click event or some external thing like a card swipe, bill acceptor read, or some device erroring out.)

                    This is what I'm going with. At first I called it MVVMC, but now I'm not sure since it's a "controller" in MVC compared to a dispatcher, but whatever. I'm liking it this though, and I'm ok with having a VM update going requiring an action that filters through the dispatcher. Not sure what the hell to call it though, as I don't think "Flux" supports ViewModels.

                    Jeremy Falcon

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #9

                    Jeremy Falcon wrote:

                    Not sure what the hell to call it though, as I don't think "Flux" supports ViewModels.

                    Yeah, I know, we had the same issue. One of the things that we learned in this process is, if you think you're architecture is doing ok, stick with it. There were a few times we almost tossed out the state manager, but we stuck with it and it has evolved into a very useful thing. We do a lot of async/await stuff (there's a layer of complexity -- it sounds so easy but it's not) so we ended up with features like the ability to defer state changes until the async stuff completed, and so forth. Works well with the "wizard-like" nature of a kiosk. Marc

                    J 1 Reply Last reply
                    0
                    • M Marc Clifton

                      Jeremy Falcon wrote:

                      Not sure what the hell to call it though, as I don't think "Flux" supports ViewModels.

                      Yeah, I know, we had the same issue. One of the things that we learned in this process is, if you think you're architecture is doing ok, stick with it. There were a few times we almost tossed out the state manager, but we stuck with it and it has evolved into a very useful thing. We do a lot of async/await stuff (there's a layer of complexity -- it sounds so easy but it's not) so we ended up with features like the ability to defer state changes until the async stuff completed, and so forth. Works well with the "wizard-like" nature of a kiosk. Marc

                      J Offline
                      J Offline
                      Jeremy Falcon
                      wrote on last edited by
                      #10

                      Marc Clifton wrote:

                      We do a lot of async/await stuff

                      That's actually what I'll be doing too, it'll be required actually, since I'm making a full-fledged single-page application for the first time in my life, and I'll need to maintain a solid client state while the server is doing its thing. Being the rebels we are, we should just remove the L and call it Fux. :)

                      Jeremy Falcon

                      M 1 Reply Last reply
                      0
                      • J Jeremy Falcon

                        Marc Clifton wrote:

                        We do a lot of async/await stuff

                        That's actually what I'll be doing too, it'll be required actually, since I'm making a full-fledged single-page application for the first time in my life, and I'll need to maintain a solid client state while the server is doing its thing. Being the rebels we are, we should just remove the L and call it Fux. :)

                        Jeremy Falcon

                        M Offline
                        M Offline
                        Marc Clifton
                        wrote on last edited by
                        #11

                        Jeremy Falcon wrote:

                        and I'll need to maintain a solid client state while the server is doing its thing.

                        Have fun with this: http://msdn.microsoft.com/en-us/magazine/jj991977.aspx[^] When we started working with async/await, we were actually spitting out debug messages with the thread ID to see how it was behaving. One problem that took half a day to debug was that, on application startup, I was calling the "sign-in" webservice function to make sure the server was up and running, but I was doing so before WPF initialized, and so there was no magic context for the await, thus it returned on a non-UI thread. Oh the joys. Personally, both I and my cohort believe async/await made life a heck of a lot more complicated. Threading used to be easy!

                        Jeremy Falcon wrote:

                        and call it Fux.

                        Two great minds, a single thought between them! :-D Marc

                        J 1 Reply Last reply
                        0
                        • M Marc Clifton

                          Jeremy Falcon wrote:

                          and I'll need to maintain a solid client state while the server is doing its thing.

                          Have fun with this: http://msdn.microsoft.com/en-us/magazine/jj991977.aspx[^] When we started working with async/await, we were actually spitting out debug messages with the thread ID to see how it was behaving. One problem that took half a day to debug was that, on application startup, I was calling the "sign-in" webservice function to make sure the server was up and running, but I was doing so before WPF initialized, and so there was no magic context for the await, thus it returned on a non-UI thread. Oh the joys. Personally, both I and my cohort believe async/await made life a heck of a lot more complicated. Threading used to be easy!

                          Jeremy Falcon wrote:

                          and call it Fux.

                          Two great minds, a single thought between them! :-D Marc

                          J Offline
                          J Offline
                          Jeremy Falcon
                          wrote on last edited by
                          #12

                          Marc Clifton wrote:

                          I was calling the "sign-in" webservice function to make sure the server was up and running, but I was doing so before WPF initialized, and so there was no magic context for the await, thus it returned on a non-UI thread.

                          Oh, the joys of multi-threaded programming and asynchronous operations. Over the web, I at least did a two year stint in Silverlight (which is all async by default) so I should be good to go with the concepts at least. Except this time around it's gonna be more client-oriented and done in JavaScript, so I'm sure I'll run into some sorta IPC issue like this.

                          Marc Clifton wrote:

                          Oh the joys. Personally, both I and my cohort believe async/await made life a heck of a lot more complicated.

                          But I'll be able to implement real-time pie charts. Think of the pie charts!! :)

                          Marc Clifton wrote:

                          Two great minds, a single thought between them!

                          Aye.

                          Jeremy Falcon

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups