People argue that the MVC graphics is flawed. I'm thinking it doesn't look like a MVC diagram in general, but looks like a MVC diagram for a framework that supports two way data bindings, like An...
granted you made this comment months ago, I laughed at it today and applaud you for that.
You're welcome!
I propose that "thanks, MVC" becomes the new "thanks, obamacare". Terrible thunderstorms in the midwest causing loss of property and chaos? Thanks, MVC. Poverty and illiteracy in America? Thanks,...
Many (including me) believe that the controllers in MVC should not contain business logic.
Sure, and they'd patent calculus if they could. The way the patent system is being run these days, particularly in but by no means uniquely to the US, they'd probably get one. Or sixteen.
It doesn't help that MVC means one of two completely different things. I sometimes have to ask "Do you mean Web MVC or Classical MVC?"
The diagrams are for illustrative purposes. They aren't exact depictions of Facebook's design. The MVC one shows what is called a facade controller. Large systems will not use a facade controller...
A dispatching mechanism can be used in combination with MVC, so basically the title sounds like a setup of MVC as something in opposition of dispatching. This of course is not true. Flux seems ...
Maybe HTML is so successful because of its shit tolerance level. It is far from perfect but it still looks better than most of the other contenders...
Their example might be biased but they do know what they are talking about. And very few companies have software development at the scale of Facebook's, so they might be right about that, but i...
Every single 'alternative MVC' that I've seen is just the MVC pattern with differently named parts.
Or maybe, just maybe, they know what they are talking about. A code-base incredibly complex that simply revealed the flaws in MVC when used in massive scales like Facebook. There are very tal...
In traditional MVC, the view updates from the model. The controller can signal for the view to update, but it doesn't have to go through the controller to do the update. What you are describing...
I think its simply a result of moving to a purely ajax driven UI. Eventually you only end up with calls to data stores.
Reason #1 : Zuckerberg is ageist, and so fosters an environment that makes newbie mistakes. Reason #2: Facebook wants to present itself as a "new microsoft or google" and to do that they have t...
I watched the fb video and it actually seems really good. I search benchmarks and it appears to be way faster then other frameworks. IMO angular is shit compared to flux/react js although I alway...
People generally do MVC wrong :)
You're ruining their anti-MVC circlejerk!
I don't think anybody here saying that MVC should always be used. What people here are complaining about is that before you say something "doesn't scale" you should probably make sure you're usin...
So they are still using MVC, just using a event bus to remove the mess that registering/unregistering handlers all over the place can cause. So still MVC, just using event bus instead of regist...
So your dispatcher is simply an event bus then. Why not call it that instead of making up a new term? There are many existing event bus impls for javascript. As for using a event bus to decoupl...
I hear what you're saying, but this was pretty poorly presented and compared. Moving from MVP to MVVM to MVC and PHP to C# to Ruby has pretty much taught me there isn't really and end all for sof...
well. yeah. it obviously doesn't scale, so why bother?
Facebook boasting on how they hacked Dalvik to run their bloated app on older Android phones https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-and...
They should be. You can use the controller to feed all the required data to the view, and just have your view present that data. Though, there's not a hard rule where the runtime or compiler woul...
They used code generation to convert their javascript libs into java, and it generated over 65000 java classes, which exceeds a limit on android 2.3 or 2.2. So they discovered they could hack the...
Oh I see. Apparently you can start off following a pattern and turn it into spaghetti code pretty easily. The thing I want to know is how that might be avoided with Flux?
if your view is updating your model, you have violated the MVC pattern. the directional flow of data is a constraint of the pattern. although angular includes a model and view, angular is not M...
Actually there is a distinct difference between MVC and Flux however I'm a little unsure how people generally do MVC.
I meant that it's easy for them to be sent over a network, or saved and replayed. But the comparison with win32 message queue is interesting, but I would say that it's not quite right, since wi...
Every breakthrough they PUBLISH, yes. Once everybody else knows something, that's a perfect time to publish if you want to maintain your competitive advantage. Publishing before everyone else k...
> I'm always interested to see how other organizations are solving > their technical problems, even if they wouldn't be able to solve > mine. For me, the war stories help. ...
We just need to take it step by step.
I should add, you don't need to use MVC to have a good app. But if you decide to go with MVC, make sure you're getting the benefits of it (since they are really great). Otherwise the framework mi...
> he can overwork them without them telling him to fuck off. There is probably far more truth to that than anyone realizes. Industry wide, not just Zuck.
It only doesn't make sense if you're not used to that particular model of MVC for web apps. Every single MVC framework for web apps seems to use those words differently.
A good case study for MVC is in spreadsheet programs. Some were written where the spreadsheet view was the data model. When it came time to add graphs and charts, these programs had issues exposi...
While clicking that image link, i'm thinking: > You better not show me the MVC triangle. Or I'm going to smack you. /smack How do you have multiple views with the same model an...
You mistakenly disconnected the view from the model. Controller manipulates Model. View pulls information from Model to display it.
I dont think I've ever seen one controller for all those models ever. Failing at MVC I see...
Yeah, I'm pretty sure this isn't fixed. Or maybe it was and they have a new one.
Just a question, how well does "asp.net/mvc" fit into the "original MVC that GUI developers" have used? (Just curious; open question to anyone)
How do you test that errors are correctly handled?
"I don't want to pretend that a web app is an event oriented UI on the server side." Thank you for that, I tell people this literally all of the time.
I feel like a barrel of Mexican jumping beans would just be a really annoying self-perpetuating rainstick. Even just the imaginary sound in my head is irritating me.
I wonder how their FLUX diagram would look like with 10 views and 10 actions. My guess it would be so much more uglier than the MVC one they show. (you cannot tell me that a web application wil...
It's a problem at most startups. When you start coding, you hire devs who work for peanuts and code features as fast as you can type, before the whole thing goes under. If the startup becomes...
I love it! That's incredibly clever. I don't know much about CLR bytecode, but I do know a little bit about the .class file format. The downside to your approach is that it would still be a str...
I agree. The graphic they used for MVC was extremely complicated and did not make any sense. It seems that they did not implement the design pattern correctly. I don't think the graphic they us...
I didn't realize that one of those links was a link to the talk. I'll watch it when I get a chance. > if you introduce a layer of indirection (a serializable logical > event queue)�...
how many inventions do you think are made by people who only use "the right tool for the job"? i'm glad there are people out there who are inventing and trying to improve despite the circlejerk...
I think we really need to set the bounds of this pun thread.
It's not Sun's fault. Model 2 was invented along with Struts by Craig McClanahan in the Jakarta project which operated under the Apache umbrella. Struts was enormously successful because develope...
"What's important" is my health and happiness. Anyone who does a job for fun is just getting screwed by their company, jobs are only for money. I think he prefers sub 30s because he can overwork ...
I think most people looked at the diagrams and immediately dismissed it. But I definitely agree with you. Seems like their actions are query/command objects and the stores are query/command handl...
indeterminate.
There is no 'real' (as in well defined) MVC. These exact same discussions all happened decades ago. There's a reason SmallTalkers don't really use MVC today. The original concerns were more abo...
Their philosophy is (in)famously to "move fast and break things", and they reportedly have a strong preference for hiring young (aka inexperienced) developers. If your entire approach to softwa...
> Not only that but I thought Views and Models were deliberately > separated, and only the Controller communicated between the two? That sounds more like the back-end librari...
Singles in your area are dying to meet you!
Focus on MVVM (haha what a bunch of buzzwords, I feel stupid). It's the thing that really really helped me make mantainable code.
https://xkcd.com/927/
They're not, react.js is unidirectional unless you explicitly set up two-way binding yourself. The point of flux is that the view calls the dispatcher which propogates changes to the store, which...
Anything to differentiate themselves from everyone else, I guess.
I blame Sun. The MVC paradigm was originally invented for desktop GUIs. Your single GUI view would have multiple controllers, each independently bound to their own widgets, and each connected t...
Let us not forget that while Facebook has contributed many very interesting and useful things to the web development community, not everything that works for Facebook works for not-Facebook. Th...
Reminds me of graceful degradation / progressive enhancement. People spent years extolling the virtues of graceful degradation and telling people to start with a solid foundation that worked fo...
I think it's more agile!
So a company whose motto is "move fast and break things", who brags that new hires put code into production in their first week, and whose founder is openly contemptuous of anyone over 30 has bui...
Open a link on reddit, and the article discusses the comments on the articles link on reddit. Mind blown.
Many models? One Controller? Guess Facebook fail MVC 101.
> Suppose you need two reactions to occur in response to a single > event. But you need those two reactions to occur in a predictable > order. The way we've handled thes...
If anything Flux takes more influence from CQRS than it does MVC. If you watch the actual talk you'll see it's largely about time, not code organization. Your code is organized in a similar manne...
After watching the presentation and taking a look at the TodoApp sample code I'm still a bit confused what the goal of flux is. It really does seem like MVC with an emphasize of the model as th...
One of the things that graphic was trying to convey was that MVC does not compose (unless you consider component architectures like React MVC -- but no one can agree on what MVC even means anymor...
I know the picture comes from wikipedia, but isn't the diagram you posted also not really correct? I mean, the model doesn't update anything, it's consumed by the view and manipulated by the cont...
Someone mentions bytecode! Quick, to the upvotorium! One day we shall have it. And it will be glorious!
All the way to infinity (but not beyond).
Actually, that "twisted" version of MVC is much closer in line with the original Smalltalk Model-view-controller philosophy, as also embodied in frameworks like Cocoa for Objective-C. If anythi...
In my opinion, compiling to JavaScript is the end of JavaScript if it becomes popular enough to displace hand-written JavaScript. It's trivial to target more than one output format if you just ha...
Not only that but I thought Views and Models were deliberately separated, and only the Controller communicated between the two? Or at least it's one way traffic from Model to View.
Personally? Because I can't wait to see Facebook burn.
Rust's pattern matching is unique in the sense that it's implemented based on the concerns of a low-level language. I know that's not what the parent comment was talking about. Patterns have a ...
Ok, am I pushing the limit with this pun?
If Rust is what got you excited about pattern matching, you're late to the party. ML had the exact same shit 40 years ago, as have several well-known languages since then.
Well, there is no rule for MVC, that a controller updates just one model. Usually, in a server-side web application you only have one model and one view that is producing the response of a reques...
Fair enough but what problem is this going to solve for me? I don't work at facebook and my time on earth is limited.
That's what happens when you deliberately filter out applicants with work/life experience.
> All this has happened before, and all this will happen again. How many more confirmations of Facebook's having jumped the shark energetically enough to make a barrel of Mexican jump...
Imagine a hospital that refused to hire doctors over 35. How many qualified, experienced doctors do you think would apply to be on staff, and how many patients would go to such a hospital if they...
> This sort of architecture is rather trivial to implement in > languages like Erlang I have a feeling though that this was mostly about Javascript. What you say will be possible ...
> other stupid designs cooked up by facebook, such as their infamous > android hack to get their bloated client running on older android > versions Could you provide a lin...
Here are some of Trygve Reenskaug 's notes about it.
Where can I learn proper MVC?
It seems like this is more related to the MVC (or MVP, MVVP, etc) that has come about as client-side javascript frameworks have become more popular. The attempt to make client-side javascript eas...
That's not MVC. That's a client-side mess masquerading as MVC. A controller talks to a model, and never a view. A view may submit input back to the controller, which then hands the appropriate ...
The switch statements are in the stores, not the dispatcher.
To be fair, while I don't quite buy Flux, React is pretty awesome.
I think they may be trying to compare against the twisted versions of MVC found in client-side javascript frameworks. It could be argued that they are not using real MVC patterns, but that doesn'...
Instead of the view going back to the model, the view can go back to the controller as an action, and it now looks just like Flux.
A controller-view can retrieve the state of multiple stores in Flux and pass those states down to its children as props. There is no need to couple a view and a store. A store should encapsulate ...
How would you describe two-way bindings with a framework like Angular ? The model and view are bound bidirectionally (changing a model property updates the view, change data in text fields update...
nope the dispatcher is usually only a few lines of code. The handler handles ideally only one sort of event. This linked code looks like a misunderstanding of the concept.
> A controller can send commands to the model to update the model's > state (e.g., editing a document). It can also send commands to its > associated view to change t...
I expect them to discover component programming. It seems like they are on that path with Flux. They are moving fast, just a few months ago they discovered static typing.
This quote: http://www.reddit.com/r/programming/comments/25nrb5/facebook_mvc_does_not_scale_use_flux_instead/chjbuic reveals a little bit about why.
It's almost as if the founder believes young and inexperienced engineers are better...
I'm still using the parts of backbone.js that make sense for each task. Is backbone not cool anymore? Well, fuck it, I'm too busy getting shit done to be cool.
This is what I came here to say. When you refuse to hire people over 30 you make a lot of "break throughs" that look pretty stupid to those with experience.
user -> like_event -> database-handler success? yes-> stored-event -> notify_friend_handler -> render_success_handler no -> db_error_event -> notify_error_handler *EDIT format ...
Yep no fan of Facebook coding either. However at least some one is talking about alternatives patterns.
Things like asm.js are exactly what needs to happen between here and somewhere sensible, though. We can't suddenly have all of the browsers in the world support a native code format and all the s...
But I think the idea is that, rather than being coupled to data structures, you build stores according to what is useful. You might have a FriendRelationStore which encapsulates mutual friendship...
But would there be any differential between what people did in the past and what they're doing now?
Completely non-derivative work!
I would be surprised if that weren't the case.
> I want to stress the importance of being young and technical," > Facebook's CEO Mark Zuckerberg, 28, told an audience at a Stanford > University startup conference in�...
This is how I prefer to call actions on disparate systems, aggregate results, and notify the view (using Akka, ZeroMQ with an Angular.js frontend). We still have a controller and view for handlin...
Seriously? If you're going to do a dispatcher like that, just use hooks and let listeners define their own parameters. Key/bucket with function pointers. Someone has to maintain that god awful sw...
So the controller is not responsible for passing data to the view, but rather, the model is? I have read that the controller being a two-way intermediary between the model and the view is a per...
Yeah, that was a tricky slide, partly because there's not a lot of consensus for what MVC is exactly - lots of people have different ideas about what it is. What we're really arguing against is b...
They'll be integrating new and exciting techniques!
Actually, the model should be a single layer (just like presentation layer, where views and controllers live). Your controllers and view would interact with services from model layer. Said servic...
But dispatcher implies a task oriented architecture instead of an action oriented architecture, so it's totally different...
We have some documentations and examples up already (see the links at http://facebook.github.io/react/blog/2014/05/06/flux.html ) - hope those are helpful, but we'll be expanding with more info o...
Thanks for the clarification, it's really interesting to me how companies this size scale their solutions. I would be interested in seeing the big picture, especially with the store, but I know y...
Rust's pattern matching is actually a pretty neat concept.
I think you are largely correct, the dispatcher just seems a beefed up controller. This really seems to more of a business practice than a programming one, which makes sense considering Facebooks...
I understood that reference ;-)
Controlled by a giant switch statement? Just say it's an interpreter for a DSL.
The dispatcher is actually not analogous to the controller, because it has no business logic. We use the same dispatcher implementation for multiple features. All it does is pass actions through ...
why are facebook's MVC views and models bidirectional? the view should not be sending any information to the model, it's a read-only state until the user interacts with the controller
Those guys never show up, they're too busy making small talk .... I'll show myself the door.
My problem is that at the end of the day/http request, it all boils down to Javascript. TypeScript, asm.js, it all comes down to the browser interpreting Javascript. Instead of the browser inte...
How do you handle errors in this model? For example, what if there is a database invariant that prevents the "like" to be registered. How does the frontend learn about the invariant violation?
Here's the twist: Javascript IS the bytecode .
Your description is good, but what you describe isn't an actor system, it's an event bus. The even bus could be implemented in terms of actors, but actors themselves are different. Actors are l...
I feel like every non-hardware "breakthrough" Facebook publishes is really just Facebook developers independently discovering what other developers have done for years. Maybe at their next confer...
Honestly at this point I'm just waiting for a standardized bytecode for manipulating a standardized, well-formed HTML document so I can write whatever script I want with however much type safety ...
...but, in this case, Facebook re-invented classical MVC, and gave it another name.
I agree completely. In practice, large web apps like the ones my company is responsible for that follow the MVC pattern end up getting view models in some form or another anyways, even though it'...
And... here's the thing... their diagram for Flux very closely resembles your MVC diagram. They're re-invented actual MVC, and decided to assign a new name to it. Aaargh!
How could they make such a crass mistake?
The only people who profess to know what the One True Tool, such as we have here in Facebook development, are those whose fortunes rest on the stock market, and thus technical marketing. You can ...
I wish one would
Personally I've found MVVM to be an apt solution to those kinds of issues. The "Model" represents a traditional MVC/MVP model, encapsulating all state and behaviour of distinct entities, and th...
As far as I can tell (and as others have said) - FB seems to have missed the boat here. Their FLUX diagram is what I understood proper MVC to be...
Just call it "pattern matching": boom, it's the hot new thing.
You're confusing an entity with a model. A model can represent the actual data entity, e.g. a User class that represents the schema of your database's User table. In MVC, the controller is resp...
How is this different than MVC with many controllers?
> Doesn't "a user" get used in multiple views? Yes. Indeed, that's the idea of a view. The point of organizing things as MVC is to prevent that from overly complicating the system. As an...
I think the title is wrongly worded. From the article their main problem isn't scale, but damage control. So that one piece of code would never become important enough to cause a domino effect ...
Not only does it have a God object smell, it's basically controlled by a giant switch statement ... HRNGHHH! Sorry, I just had a small stroke.
In MVC, a controller / model can / will update multiple data structures via tight coupling. Here they chain the updates by sending messages back to the controller (dispatcher) to other stores loo...
Give up on what? What does what other dev shops do matter at all? Programming is just a way to solve a problem, and there are a thousand ways to skin a cat.
I am fond of the "event driven" approach. This system doesn't need it's unique implementation, however. It's not a daunting challenge to set up observers/listeners that abstract away some of the ...
Doesn't "a user" get used in multiple views? Isn't that what they're illustrating here? With what your saying, "a user" is only used to login, but nothing else. A single controller might pull fro...
I know I'm not as hardcore as the devs at Facebook, but I wonder how much of the failing of MVC has to do with technical debt. We've all been there, where we build something and due to business p...
You're missing the most important point, which is gating new features to selective groups of users. I can't make different users hit different branches on production servers (at least not without...
> behaviorless models Annnnd.... there's the problem. What is being modeled if one's model has no behavior? That's not MVC. MVC assumes the model comes first and is independent of the views an...
It's difficult for someone to learn what a new tool is good for when their immediate reaction to seeing the words "JavaScript" or "framework" is to whine about it.
Creating things; that is the fun part, right? If they can put something together that works for them, who gives a rat's ass what outsiders think? I'm not impressed with FB's coding, though. Tak...
> The models are responsible for enforcing the business logic - that's > what they're for. Right, but the controller is still doing the update--by calling the appropriate method on...
It is nice to see discussion on patterns other than MVC, event though judging by most the comments on this thread there is a long way to go before the general internet population start to look at...
The difference is that feature toggles add complexity to code paths in many many if statements to determine which code path / feature code to run. That means to reproduce a bug you must know the ...
This proposed system still seams to have the same tight coupling problems. Here is a different idea that has been working well for an extremely complex system that does not work well with MVC. ...
"We don't know how to implement MVC and so our interdependent spaghetti code is too difficult to maintain."
What is the difference?
> updates of all the models it interacts with No, the update of one model should be triggering updates in other models. If the user is asked to add a friend, it should also tell the frie...
Exactly. The model should be one model, with multiple things updating it. A model is something like "a user" or "a company" or "a class" (in an IDE), with a variety of ways of reading and writing...
Most understandings of MVC are misunderstandings though. Wait until the SmallTalk programmers show up and explain Real MVC.
My takeaway from just glancing at this, although I don't think I understand it particularly well yet, I think I understand and agree with the the general idea. First of all, I think the recogni...
I thought the exact same thing. "Our misunderstanding of MVC sucks, you shod totally use real MVC"
Not lost just obscured by bloggers and elitist developers. I think most businesses enforce that attitude but often to the extreme of getting the job done poorly.
As far as more than one, I thought that was what it said -- per domain.
Judging on them clearly misunderstanding the MVC architecture (as others have mentioned) I'm more inclined to believe that their complexity is more of a factor of using feature toggles instead of...
> whatever gets the job done. it seems "the right tool for the job" mentality has been lost
It seems that this architecture is shifting MVC to something that looks event-based. "Stores" register themselves (and presumably any call-order dependencies) with the dispatcher, and the dispatc...
Dispatcher = Controller Store = Model View = View Something I am missing? Given the other stupid designs cooked up by facebook, such as their infamous android hack to get their bloated cl...
Another JavaScript framework and design pattern? Ugh. I give up. I'm going to wait for the one framework and design pattern to rule them all. In the meantime I'll stick with doing whatever the he...
> For one, their MVC Graphic is insanely flawed. I thought the same thing. They made it appear way more complex than it should ever be.