Live data from Hacker News

GUI Architectures

martinfowler.com

11–20 of 26 posts

Re: GUI Architectures

#11
post #6
post #3

Earlier quoted context omitted.

This seems to be a recurring phenomenon on HN. Why is the timestamp given so much importance?

The N in HN is supposed to mean "News". Imagine a news paper that reprints issues from six years ago.

Wait until you find out that some of dijkstra's letters make it to the front page.

Re: GUI Architectures

#12
post #5
post #3

Earlier quoted context omitted.

This seems to be a recurring phenomenon on HN. Why is the timestamp given so much importance?

Because things change fast in the industry.

Yet mainstream languages are just catching up now to the state of the art of 30 years ago.

Re: GUI Architectures

#13
post #10

What is the real cost of getting this "wrong"? For example: Backbone.js is following the MVP pattern, more specifically the passive view variant. The catch is that Backbone.js calls Presenters Views and Views Templates. Should we be encouraging "correctness" here or is it ok that every new MV* framework reinterprets these patterns?

I think there is a contention in what MV* preaches and the reality of UI development now that it is disconnected from the server. Traditional MVC has followed a struts like architecture where the C is a procedural workflow that starts at A and end at Z. This encouraged a dumb V where say the header of a site was an HTML template and that the C would then populate with the M. This benefited the service oriented nature of HTTP request, they are a procedural workflow pattern where the request is initiated and work is done and a response is returned. This worked great for the old way of doing thing, compromises had to be made given that the view was generated and then delivered.

Fast forward to today and the UI can now be decoupled from the back-end technology so it is natural to evaluate whether or not the old patterns apply to new practices. In the old model, event based development and widgets had little advantage, event's where overly complex for a service oriented architecture, where a unit of processing is done and then a response is returned. It made little sense to bring in the indirection of event based programming. Further black boxing UI elements into widgets had little advantage because they could not directly respond to events that happen on the client side, in the old way, if a button was clicked, the server had to be notified and it would require complex routing to get that request back to a discreet widget that would have to be recreated or cached and looked up with every request. MVC with procedural C's where the best pattern available to deal with this reality.

Now jumping back to the present, we are not under the same constraints, code can be delivered to the client, the client can respond to events and the client can request processing and data from the back end. Based on this reality, procedural C's don't make a lot of sense, rather events and widgets become a more discreet solution. Designed well, a UI can actually rid itself of almost all procedural glue code external to widgets, via event routing and syndication. In this new reality there is little need to have a controller that says you do this and then you do this. Rather you can build widgets that say when this happens I will do this and when that happens I will tell everyone about this.

Given the dogmatic view of MVC being a best practice people sometimes try to draw parallels and call what they are doing MVC. A better description of MVC or widgets is separations of concerns which is still valid. You should not have JavaScript in HTML and you should not generate HTML from strings in JavaScript. Rather just like in MVC a widget should have an HTML template that represents the view. Some people call widgets micro-MVC which I suppose is correct, but to my MVC implies a controller orchestration a workflow in which I think we are trying to force definitions to not look like the guy that does not know what he is doing. That being said, I think trying to square peg round hole Event/Widget UI development into a MVC definitions is causing a lot of confusion. I think MVC is a relic of web 1.0 page/post programming. What people are really trying to say when they say MVC on the client, is separation of concerns which is still a very relevant and good practice.

Re: GUI Architectures

#15
post #9
post #6

Earlier quoted context omitted.

The N in HN is supposed to mean "News". Imagine a news paper that reprints issues from six years ago.

"On-Topic: Anything that good hackers would find interesting." The age of an article has no bearing on how interesting a good hacker would find it.

To make myself clear, I personally don't care that much about older articles. Anyway, I think it's good hn practice for older articles to put the year in title ... since many users might expect "news" or are old enough to have been pointed to those articles several times.

Re: GUI Architectures

#16
post #13
post #10

What is the real cost of getting this "wrong"? For example: Backbone.js is following the MVP pattern, more specifically the passive view variant. The catch is that Backbone.js calls Presenters Views and Views Templates. Should we be encouraging "correctness" here or is it ok that every new MV* framework reinterprets these patterns?

I think there is a contention in what MV* preaches and the reality of UI development now that it is disconnected from the server. Traditional MVC has followed a struts like architecture where the C is a procedural workflow that starts at A and end at Z. This encouraged a dumb V where say the header of a site was an HTML template and that the C would then populate with the M. This benefited the service oriented nature…

I'm confused. MVC wasn't created for web 1.0 page/post programming. It was created for Desktop applications which are very similar to todays front-end heavy applications.

I think the pattern you're referring to is more like a Model2 (JSP/Rails) style pattern.

Re: GUI Architectures

#17
post #13
post #10

What is the real cost of getting this "wrong"? For example: Backbone.js is following the MVP pattern, more specifically the passive view variant. The catch is that Backbone.js calls Presenters Views and Views Templates. Should we be encouraging "correctness" here or is it ok that every new MV* framework reinterprets these patterns?

I think there is a contention in what MV* preaches and the reality of UI development now that it is disconnected from the server. Traditional MVC has followed a struts like architecture where the C is a procedural workflow that starts at A and end at Z. This encouraged a dumb V where say the header of a site was an HTML template and that the C would then populate with the M. This benefited the service oriented nature…

[deleted]

Re: GUI Architectures

#19
post #16
post #13

Earlier quoted context omitted.

I think there is a contention in what MV* preaches and the reality of UI development now that it is disconnected from the server. Traditional MVC has followed a struts like architecture where the C is a procedural workflow that starts at A and end at Z. This encouraged a dumb V where say the header of a site was an HTML template and that the C would then populate with the M. This benefited the service oriented nature…

I'm confused. MVC wasn't created for web 1.0 page/post programming. It was created for Desktop applications which are very similar to todays front-end heavy applications. I think the pattern you're referring to is more like a Model2 (JSP/Rails) style pattern.

Yes I understand that MVC predates the web, but it's surge in popularity was definitely from it's adoption as a best practice for web development and the web for the most part took the traditional view of MVC. That being said it did see some popularity in many imperative languages for desktop application but nowhere near it's popularity after the web. But I would say it and Event/Widget style UI's where neck and neck until the web's explosion.

The thing is now we try to explain evented systems in terms of MVC and I believe that we are trying to force the definition when what we are really trying to say is separation of concerns. Here is a good thread from that period that goes over how the two became jumbled together: http://c2.com/cgi/wiki?WhatsaControllerAnyway it's long the tldr; is smalltalk took the traditional view that controllers are independent of UI, they don't even know what the UI will look like. Where widget based systems such as swing where utilizing the same definition, but yet widgets where tightly coupled to the view they control by being the intelligent manipulators of a discreet view, but proper separation is observed in that all view elements exist in a HTML (or other UI) files, and the controller is a code-behind file, together they represent a discreet element.

Traditionally, this has not been considered MVC until the web UI started moving back to the client and now due to MVC achieving almost religious omnipotence people are wary of something not being MVC even if they have to make the definition match the practice.

on an interesting side note, I often wonder had MVC been as popular before the web, as it was after the web, would an event model have been chosen for the browser?

Re: GUI Architectures

#20
post #13
post #10

What is the real cost of getting this "wrong"? For example: Backbone.js is following the MVP pattern, more specifically the passive view variant. The catch is that Backbone.js calls Presenters Views and Views Templates. Should we be encouraging "correctness" here or is it ok that every new MV* framework reinterprets these patterns?

I think there is a contention in what MV* preaches and the reality of UI development now that it is disconnected from the server. Traditional MVC has followed a struts like architecture where the C is a procedural workflow that starts at A and end at Z. This encouraged a dumb V where say the header of a site was an HTML template and that the C would then populate with the M. This benefited the service oriented nature…

I think you forget that MVC is a pattern and not a specific method or an implementation. MVC could care less whether something is procedural, evented, client or serverside.
Post reply on HN