News for hackers. Stuff that matters.
Re:What Comes After MVC by zkhalique on Monday May 25, 2015 @01:28PM (#9600880)
Why not just have MVC for the page, and MVC for components?

Each component would render itself.

I personally think that this requires a lot of machinery under the hood, such as caching and batching requests (since no one knows ahead of time what components will need to be rendered).

At least that's what we built in our Qbix Platform (http://platform.qbix.com). Reusable components you just place on a page and they "just work". Unlike React, etc. they support more than just re-rendering. You can of course have a virtual DOM (via a lib like Mithril or https://github.com/Matt-Esch/virtual-dom etc.) but it would be nice to handle other kinds of events besides just "re-rendering".

Re:What Comes After MVC by emidln on Monday May 25, 2015 @01:52PM (#9600951)
When I built this a couple companies ago for a charting/dashboarding app, we used components simply had channels to receive events and send events. When a component was to be loaded, it provided a map of its data dependencies so that we could ensure efficient batching and appropriately updated queries. Unloading was resolving that in reverse. Clojurescript + core.async and some macros made this very very easy to implement, use, and extend, but you could easily do it on top of whatever random messaging system and virtual-dom you wanted.

In my app's scenario, we made a render decision based on the input and output for the component render functions. Prior to rendering the view, if the data was identical to what already existed, no updates occurred. cljs made this cheap. After constructing the template (hiccup-style, more cljs data), if it wasn't different, we'd also skip the DOM update.

For methods on the component (handling various events and such), they all take a channel where they could send whatever events it was that they needed to send.

The data service managing a query for one or more components just blocked its goroutine until it received an update to its query data structure, resolved it, and if it was different than the existing query data structure, would debounce for more changes before sending off the request. Requests back to the server were ordered by an atomic counter (atom 0) such that out of order responses could be processed sanely. Everything was one-way.

Additionally, while we could dynamically render everything, pages were a layout data structure containing 0 or more components with associated data services. These were all described in EDN and thus could be serialized, queried, and rendered server side if necessary.

All of this machinery was pretty small, no more than about 1800 LOC building on top of some excellent cljs libraries.

Re:What Comes After MVC by ac2u on Tuesday May 26, 2015 @07:54AM (#9604122)
The data dependencies mapping part sounds a little bit like FB's relay proposal https://facebook.github.io/react/blog/2015/02/20/introducing...
Re:What Comes After MVC by emidln on Tuesday May 26, 2015 @02:46PM (#9606781)
Yes. We had a query language that let us string together AND/OR/NOT filters as a tree and then the backend could decompose and query off of it. We'd have a data service per document type being queried. In our situation, customer feedback aggregates, vertical aggregates and customer feedback datums were different. So a page containing components using both would necessarily have two data services working independently.
Re:What Comes After MVC by Hansi on Tuesday May 26, 2015 @05:06PM (#9607661)
Any good pointers on reading material for architecturing something like this? Would be interested in more details.
Re:What Comes After MVC by colinramsay on Monday May 25, 2015 @02:29PM (#9601099)
I did some research into MVC a few months ago for a book [1] and my understanding is that this is how it worked when the concept was first devised in those first few Smalltalk releases: something like a textbox would still have the M and the V and the C. React just feels like a simplified version of that to me.

https://www.packtpub.com/web-development/ext-js-application-...

Re:What Comes After MVC by derefr on Wednesday May 27, 2015 @11:56AM (#9612246)
Seaside (http://www.seaside.st/), the Smalltalk web-application framework, does exactly what you're talking about—each component on the page has its own server-side view-controller, much like if you were using a controls library in a native GUI app.

One should also note that Seaside is likely the direct inspiration for Arc's (i.e. HN's) use of links that reference stored server-side closures by ID.

Re:What Comes After MVC by muraiki on Wednesday May 27, 2015 @08:45PM (#9615414)
The free Seaside book and also the free Pharo by Example book are great ways to learn MVC. The only downside is that after using Seaside and a Smalltalk environment, you will probably be dissatisfied with not having such awesome features available in modern tools. :)

Edit: It looks like there is a new Pharo book that covers more advanced topics! http://deepintopharo.com/

Re:What Comes After MVC by emehrkay on Monday May 25, 2015 @02:36PM (#9601134)
Re:What Comes After MVC by erikpukinskis on Monday May 25, 2015 @04:22PM (#9601575)
Any sentence of the form "everything is an _______" is going to lead you to trouble. It doesn't matter if the _______ is a function or a monolith or an MVC app or a file or an event or a closure or a command. You end up being theoretically correct, but you're really only saying "I want a small toolbox".

The framework you are programming in is the entirity of computer science. Good libraries are the ones that do their job well and don't get in the way of your using other tools to solve other problems.

Once you set up camp inside a framework and declare you're not coming out, whether it's MVC or immutable state or Salesforce or whatever, you're basically guaranteeing that you're going to be spending a big chunk of your day sanding down square pegs to fit in round holes.

Re:What Comes After MVC by tdestan on Monday May 25, 2015 @06:19PM (#9601969)
This is like attempting to counter a proposed rule/guideline of program design by saying, "You should always use the best tool for the job." While technically true, it doesn't say anything about what makes a tool suitable for a job. Similarly here, maybe there are common patterns/rules followed by libraries that "do their job well and don't get in the way of using other tools." But dismissing any proposed rule just cuts off the conversation without giving a reason. The details really do matter.

I think what bothers me most about this way of thinking (which seems common here and elsewhere in the industry) is that it provides a veneer of credibility to bad developers who don't want to think about design and would prefer to just wing it.

Re:What Comes After MVC by tracker1 on Tuesday May 26, 2015 @04:33AM (#9603523)
Be pragmatic.. use the best tool at your disposal that suits your larger environment. If the company you work for is all .Net, they bringing in a small utility app that uses Python is a pretty big risk. The same can be said for most things in a given environment.

That said, I gave node a beachhead into a number of projects, because they were web applications and it made sense to do so. Even if not running on node, having the client-side bits using node tools made sense.

It really just depends. All in all, there are at least a dozen options for any given problem, and 4 out of 5 times the closest thing to what you are already doing is likely the right answer.

Re:What Comes After MVC by derefr on Wednesday May 27, 2015 @11:57AM (#9612253)
Yes, the point is—depends on what? That's the useful conversation to have.
Re:What Comes After MVC by chinathrow on Monday May 25, 2015 @01:54PM (#9600959)
"If you’re here at RailsConf today, please come talk to me. This is not reality TV, I am here to make friends."

That sounds great as a first. However, I fail to understand why you want a working e-mail to be able do d/l the slides. No pricavy policy, no word on what happens after you "signup"...

Re:What Comes After MVC by Harkins on Monday May 25, 2015 @02:04PM (#9601002)
[author here]

Because I'm also sending a lot more info on things I had to cut from the talk for time (eg. samples of test code). I haven't finished or polished the stuff that I knew early I had to cut, so it's coming out as I can finish it.

Sorry it was unclear, I'll improve the text on that pgae.

Re:What Comes After MVC by Shengbo on Monday May 25, 2015 @03:09PM (#9601264)
I think it would be nice to make that clear and allow people to make a choice. Otherwise most people will just use a spam address they never check.
Re:What Comes After MVC by Harkins on Monday May 25, 2015 @03:31PM (#9601352)
Yep. I've also seen a few people using the same strategy I do of [email protected] so they can recognize when email addresses get abused and trivially filter them.

For what it's worth, I have cleaned up enough servers hacked by spammers that I'll never send one. I guess I should mention that.

Re:What Comes After MVC by toxicFork on Tuesday May 26, 2015 @03:05AM (#9603319)
That works until someone writes a script that removes any \+[^@]+ from specific email domains :)
Re:What Comes After MVC by derefr on Wednesday May 27, 2015 @12:01PM (#9612285)
I've never seen that (or any other purposeful filtering of address tags.) On the other hand, I can't count the number of sites that were just programmed with an address validation regex that is unaware of the existence of address tags, and therefore thinks your email address with a plus in it is invalid.
Re:What Comes After MVC by chinathrow on Monday May 25, 2015 @03:25PM (#9601322)
You need an address to get the slides download link in his case.
Re:What Comes After MVC by chinathrow on Monday May 25, 2015 @02:13PM (#9601038)
Thanks for your feedback. I was really interested in the slides - but not on a newsletter subscription.
Re:What Comes After MVC by hyperpape on Tuesday May 26, 2015 @09:58AM (#9604853)
This is a really nice talk, and I wish I had something like it that was language-agnostic (or Java). Though I found it comprehensible as a non-rubyist, I suspect some people might convince themselves that they can't follow it because of the rails jargon.

I've read a lot about the benefits of immutability, but most discussions don't go so far as to describe how to a) refactor existing systems, b) structure the interacting parts that a web app might need.

Re:What Comes After MVC by Harkins on Tuesday May 26, 2015 @10:38AM (#9605145)
Thanks, I'm really glad to hear a non-rubyist liked it. You put your finger on a really hard balancing act: the more Rails and Ruby specific it is, the more I can offer really practical steps for how to improve the Rails apps I spend all day in. But the more I talk about the general stuff, the more anyone can see that there's general principles at work that are useful in understanding and improving the design that are more useful than a list of gems to use.
Re:What Comes After MVC by hyperpape on Tuesday May 26, 2015 @11:08AM (#9605315)
I should say, I've written a few hundred lines of Ruby, am a language geek, and perhaps most importantly, have somehow ended up reading a lot of blog posts by people who write Ruby. I can't speak to how it would come across to someone who didn't have that superficial level of familiarity.
Re:What Comes After MVC by DonHopkins on Monday May 25, 2015 @04:32PM (#9601615)
The 1980's?
Re:What Comes After MVC by Ace17 on Tuesday May 26, 2015 @02:42AM (#9603261)
You just made my day :-)
Re:What Comes After MVC by innguest on Tuesday May 26, 2015 @01:20AM (#9603079)
Found my corner. The first thing I thought when I read the headline was 'what came after MVC' FTFY.
Re:What Comes After MVC by evtothedev on Monday May 25, 2015 @03:39PM (#9601375)
I was literally just playing around with different ways to extract addresses from ActiveRecord models into value objects. I have gotten burned by clumsiness in Rails's `composed_of` before - glad to see that it'll be in attributes in Rails 5. I also think it's great to see alternatives to `include Comparable` in the Equalizer gem.
Re:What Comes After MVC by chipsy on Monday May 25, 2015 @08:14PM (#9602292)
It's a good talk. Puts together some common themes of the moment: immutability, referential transparency, shrinking the responsibilities of the data, entity-component systems to track aggregations of data, and an "escape hatch" for moving necessarily side-effectful code into the smallest possible context.
Re:What Comes After MVC by innguest on Tuesday May 26, 2015 @01:16AM (#9603070)
Just spell it out, will ya? M-o-n-a-d-s. ;)
Re:What Comes After MVC by Harkins on Tuesday May 26, 2015 @10:30AM (#9605090)
After I gave the talk, an audience member came and thanked me for giving such a nice Haskell talk. I said "shhhhhh!"
Re:What Comes After MVC by kristopolous on Monday May 25, 2015 @02:53PM (#9601198)
I'm sure Martin Fowler has an opinion on this.
Re:What Comes After MVC by throwawayaway on Monday May 25, 2015 @03:52PM (#9601449)
YEP:

https://en.wikipedia.org/wiki/Model_View_ViewModel

apart from agile manifestos and talking about stuff, do you know what programs has he actually worked on?

other ones:

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93pres...

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93adap...

Re:What Comes After MVC by Harkins on Monday May 25, 2015 @04:17PM (#9601555)
I didn't talk about MVVM in this talk, pretty much all of my examples were about decomposing the M.

That said, I'd love to hear what Fowler thinks of it, too.

Re:What Comes After MVC by kristopolous on Monday May 25, 2015 @04:27PM (#9601592)
I bet he'll respond to emails. Seems like a nice guy from his writing style.
Re:What Comes After MVC by ExpiredLink on Tuesday May 26, 2015 @04:56AM (#9603594)
Martin Fowler has two opposing opinions on everything.
Re:What Comes After MVC by miguelrochefort on Monday May 25, 2015 @07:19PM (#9602150)
UI will be generated dynamically based on the user, context and state of the semantic knowledge graph. No more UI will be built by hand.
Re:What Comes After MVC by DonHopkins on Tuesday May 26, 2015 @08:03AM (#9604169)
Well that's been the holy grail for a long time. But I believe it's also important to put the ability and literacy to build UI, and powerfully compose extensible high level building blocks, into the hands of the user.

The dynamic generation tools should be able to remember and apply the changes and preferences the user and their context require, but the user still needs complete control to easily make one-off special purpose "instance first" interfaces, and then iteratively generalize, abstract and refactor them into reusable specifications, rules, classes and prototypes.

By "instance first" I'm referring to the term Oliver Steele used to describe declarative programming with constraints in OpenLaszlo:

https://news.ycombinator.com/item?id=7756151

http://blog.osteele.com/posts/2004/03/classes-and-prototypes...

Re:What Comes After MVC by solidr53 on Tuesday May 26, 2015 @04:14AM (#9603479)
One word, HMVC.
Re:What Comes After MVC by comrade1 on Monday May 25, 2015 @03:42PM (#9601402)
Take a look at Apache Sling's content-driven/content-focused way of displaying information. Once you get your head wrapped around it it makes perfect sense for displaying content rather than data, which is better for mvc.